Date: Wed, 10 Jul 2002 11:11:30 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Archie Cobbs <archie@dellroad.org> Cc: Julian Elischer <julian@elischer.org>, freebsd-current@FreeBSD.ORG, David Xu <davidx@viasoft.com.cn> Subject: Re: Timeout and SMP race Message-ID: <XFMail.20020710111130.jhb@FreeBSD.org> In-Reply-To: <200207100334.g6A3Yp323268@arch20m.dellroad.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10-Jul-2002 Archie Cobbs wrote: > John Baldwin writes: >> > code would be modified to fit this new behaviour, besides this, everywhere >> > callout_stop() is used need to hold sched_lock and do a mi_switch() and >> > modify td_flags is also unacceptable, this SMP race should be resolved in >> > kern_timeout.c. >> >> How would you resolve it while still preserving the existing semantics? >> Saying "this race should be resolved" doesn't explain how you would go about >> resolving it. It's a lot harder than it looks. > > I don't know if this is the same problem or a different problem, but FWIW.. It is the same problem. What we do is change callout_stop() to let you know if it actually stopped the timeout or not. You then have to use your own locking and synchronization in the timeout function and yourself to close the rest of the race. -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020710111130.jhb>