From owner-freebsd-current Thu Jul 4 1:59:14 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 AE45D37B400 for ; Thu, 4 Jul 2002 01:59:11 -0700 (PDT) Received: from mail.viasoft.com.cn (ip-167-164-97-218.anlai.com [218.97.164.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B48543E3B for ; Thu, 4 Jul 2002 01:59:08 -0700 (PDT) (envelope-from davidx@viasoft.com.cn) Received: from davidwnt (davidwnt.viasoft.com.cn [192.168.1.239]) by mail.viasoft.com.cn (8.9.3/8.9.3) with SMTP id RAA26175; Thu, 4 Jul 2002 17:14:48 +0800 Message-ID: <00f401c22337$c6c94d90$ef01a8c0@davidwnt> From: "David Xu" To: "Julian Elischer" Cc: References: Subject: Re: Timeout and SMP race Date: Thu, 4 Jul 2002 16:49:57 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 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 ----- Original Message -----=20 From: "Julian Elischer" To: "David Xu" Cc: 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