From owner-cvs-src@FreeBSD.ORG Mon Nov 1 10:51:13 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A33EF16A4CE; Mon, 1 Nov 2004 10:51:13 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85E8E43D3F; Mon, 1 Nov 2004 10:51:13 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 7AE535D1DA; Mon, 1 Nov 2004 02:51:13 -0800 (PST) Date: Mon, 1 Nov 2004 02:51:13 -0800 From: Alfred Perlstein To: Alan Cox Message-ID: <20041101105113.GS24892@elvis.mu.org> References: <200410311932.i9VJWvmo058193@repoman.freebsd.org> <20041101031317.GK24892@elvis.mu.org> <20041101045331.GP16728@cs.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101045331.GP16728@cs.rice.edu> User-Agent: Mutt/1.4.2.1i cc: Alan Cox cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_zeroidle.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2004 10:51:13 -0000 * Alan Cox [041031 20:53] wrote: > On Sun, Oct 31, 2004 at 07:13:17PM -0800, Alfred Perlstein wrote: > > * Alan Cox [041031 11:33] wrote: > > > alc 2004-10-31 19:32:57 UTC > > > > > > FreeBSD src repository > > > > > > Modified files: > > > sys/vm vm_zeroidle.c > > > Log: > > > Introduce a Boolean variable wakeup_needed to avoid repeated, unnecessary > > > calls to wakeup() by vm_page_zero_idle_wakeup(). > > > > > > Revision Changes Path > > > 1.31 +9 -2 src/sys/vm/vm_zeroidle.c > > > > Why not switch to a cv? > > Calling cv_signal repeatedly would be no better than calling wakeup() > repeatedly. Either way, a Boolean variable is desirable to prevent > unnecessary calls. Yah, I figured there would be something in the cv code to optimize the "no waiters" case. > As for the question of msleep()/wakeup() vs. cv_wait*()/cv_signal(), > cv_wait*() has no analogue to msleep()'s PDROP. In this case, there > is no need to hold the lock after returning from the sleep. So, > msleep(PDROP) is better suited to this case. Didn't see that. thank you, -Alfred