From owner-cvs-all Thu Jul 5 15:41:53 2001 Delivered-To: cvs-all@freebsd.org Received: from sneakerz.org (sneakerz.org [216.33.66.254]) by hub.freebsd.org (Postfix) with ESMTP id BC08437B407; Thu, 5 Jul 2001 15:41:45 -0700 (PDT) (envelope-from bright@sneakerz.org) Received: by sneakerz.org (Postfix, from userid 1092) id 25BE45D010; Thu, 5 Jul 2001 17:41:35 -0500 (CDT) Date: Thu, 5 Jul 2001 17:41:35 -0500 From: Alfred Perlstein To: "Justin T. Gibbs" Cc: John Baldwin , Jake Burkholder , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Matt Dillon , Matthew Jacob , Doug Rabson Subject: Re: cvs commit: src/sys/sys systm.h condvar.h src/sys/kern kern_ Message-ID: <20010705174135.A79818@sneakerz.org> References: <200107052228.f65MSeU64741@aslan.scsiguy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200107052228.f65MSeU64741@aslan.scsiguy.com>; from gibbs@scsiguy.com on Thu, Jul 05, 2001 at 04:28:40PM -0600 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Justin T. Gibbs [010705 17:28] wrote: > >It happens with SMP, too, not just preemption. The calls are an optimization > >to avoid problems with releasing the lock after the wakeup. The contention > >can be avoided if we release the lock before calling wakeup(), but doing that > >leaves a window open for another CPU to alter the data that the lock protects > >possibly invalidating the wakeup that then gets sent. > > This window exists anyway. The locked mutex it not passed to the woken > up thread, so there will always be a race between the woken up thread > acquiring the mutex and some other thread on some other CPU acquiring it > first and making the wakeup invalid. Y'know this sorta got me thinking about something else, shouldn't the wakeup() calls for most exclusive locks use wakeup_one? I know wakeup_one() hoses priority, but for the locks in things like vnodes and the pager locks, shouldn't we do a wakeup_one() since it is an exclusive lock? -- -Alfred Perlstein [alfred@freebsd.org] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message