Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jul 2002 16:49:57 +0800
From:      "David Xu" <davidx@viasoft.com.cn>
To:        "Julian Elischer" <julian@elischer.org>
Cc:        <freebsd-current@FreeBSD.ORG>
Subject:   Re: Timeout and SMP race
Message-ID:  <00f401c22337$c6c94d90$ef01a8c0@davidwnt>
References:  <Pine.BSF.4.21.0207040135220.6975-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

----- Original Message -----=20
From: "Julian Elischer" <julian@elischer.org>
To: "David Xu" <davidx@viasoft.com.cn>
Cc: <freebsd-current@FreeBSD.ORG>
Sent: Thursday, July 04, 2002 4:36 PM
Subject: Re: Timeout and SMP race


>=20
>=20
> On Thu, 4 Jul 2002, David Xu wrote:
>=20
> > 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=20
> > 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=20
> > kern_timeout.c. =20
> >=20
> > David Xu
>=20
> This is probably true..
> the current hacks for this are rather horrible. I think there msut be
> better ways. Your suggestion sounds plausible.
>=20
>=20

if another thread other than softclock itself is calling callout_stop(),
and callout_stop() detected that softclock is currently running the=20
callout,  it should wait until softclock finishes the work, then return.

-David Xu



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?00f401c22337$c6c94d90$ef01a8c0>