Re: New "timeout" api, to replace callout
- From: Andre Oppermann <andre@xxxxxxxxxxx>
- Date: Sun, 02 Dec 2007 13:53:18 +0100
Poul-Henning Kamp wrote:
In message <4752998A.9030007@xxxxxxxxxxx>, Andre Oppermann writes:o TCP puts the timer into an allocated structure and upon close of the
session it has to be deallocated including stopping of all currently
running timers.
[...]
-> The timer facility should provide an atomic stop/remove call
that prevent any further callbacks upon return. It should not
do a 'drain' where the callback may be run anyway.
Note: We hold the lock the callback would have to obtain.
It is my intent, that the implementation behind the new API will
only ever grab the specified lock when it calls the timeout function.
This is the same for the current one and pretty much a given.
When you do a timeout_disable() or timeout_cleanup() you will be
sleeping on a mutex internal to the implementation, if the timeout
is currently executing.
This is the problematic part. We can't sleep in TCP when cleaning up
the timer. We're not always called from userland but from interrupt
context. And when calling the cleanup we currently hold the lock the
callout wants to obtain. We can't drop it either as the race would
be back again. What you describe here is the equivalent of callout_
drain(). This is unfortunately unworkable in TCP's context. The
callout has to go away even if it is already pending and waiting on
the lock. Maybe that can only be solved by a flag in the lock saying
"give up and go away".
--
Andre
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: New "timeout" api, to replace callout
- From: John Baldwin
- Re: New "timeout" api, to replace callout
- From: Poul-Henning Kamp
- Re: New "timeout" api, to replace callout
- References:
- Re: New "timeout" api, to replace callout
- From: Poul-Henning Kamp
- Re: New "timeout" api, to replace callout
- Prev by Date: Re: New "timeout" api, to replace callout
- Next by Date: Re: New "timeout" api, to replace callout
- Previous by thread: Re: New "timeout" api, to replace callout
- Next by thread: Re: New "timeout" api, to replace callout
- Index(es):
Relevant Pages
|