From owner-freebsd-current Mon Jul 8 16:52:48 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 56F4437B400 for ; Mon, 8 Jul 2002 16:52:45 -0700 (PDT) Received: from web20902.mail.yahoo.com (web20902.mail.yahoo.com [216.136.226.224]) by mx1.FreeBSD.org (Postfix) with SMTP id AF91543E58 for ; Mon, 8 Jul 2002 16:52:44 -0700 (PDT) (envelope-from bsddiy@yahoo.com) Message-ID: <20020708235244.76569.qmail@web20902.mail.yahoo.com> Received: from [218.108.154.127] by web20902.mail.yahoo.com via HTTP; Mon, 08 Jul 2002 16:52:44 PDT Date: Mon, 8 Jul 2002 16:52:44 -0700 (PDT) From: David Xu Subject: Re: Timeout and SMP race To: John Baldwin Cc: "freebsd-current@FreeBSD.org" , Julian Elischer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I want to set an flag bit CALLOUT_PROCESSING in callout.c_flags, before softclock() releases callout_lock and start requesting callout.c_func(), so callout_stop can find that callout is processing by softclock and wait, after softclock processed the callout, it resets the flag and wakeup callout_stop thread, of course, if callout_stop is being called in softclock() thread, it should avoid waiting, it is easy to detect. David Xu ----- Original Message ----- From: "John Baldwin" To: "David Xu" Cc: ; "Julian Elischer" Sent: Tuesday, July 09, 2002 3:27 AM Subject: RE: Timeout and SMP race > > On 04-Jul-2002 David Xu wrote: > > while we are getting rid of Giant, current race condition between softclock() > > and callout_stop() is unacceptable. the race causes two many places in source > > 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. > > -- > > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message