Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jul 2002 16:52:44 -0700 (PDT)
From:      David Xu <bsddiy@yahoo.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        "freebsd-current@FreeBSD.org" <freebsd-current@FreeBSD.org>, Julian Elischer <julian@elischer.org>
Subject:   Re: Timeout and SMP race
Message-ID:  <20020708235244.76569.qmail@web20902.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
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" <jhb@FreeBSD.org>
To: "David Xu" <davidx@viasoft.com.cn>
Cc: <freebsd-current@FreeBSD.org>; "Julian Elischer" <julian@elischer.org>
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 <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020708235244.76569.qmail>