From owner-freebsd-current Tue Aug 25 02:12:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA26682 for freebsd-current-outgoing; Tue, 25 Aug 1998 02:12:35 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA26672 for ; Tue, 25 Aug 1998 02:12:26 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.9.1/8.8.5) with SMTP id KAA28244; Tue, 25 Aug 1998 10:11:36 +0100 (BST) Date: Tue, 25 Aug 1998 10:11:36 +0100 (BST) From: Doug Rabson To: "John S. Dyson" cc: current@FreeBSD.ORG Subject: Re: Serious bug in vm_page.h in current In-Reply-To: <199808250840.DAA00444@dyson.iquest.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 25 Aug 1998, John S. Dyson wrote: > Doug Rabson said: > > On Tue, 25 Aug 1998, John S. Dyson wrote: > > > > > > > > PAGE_BUSY is used to set the busy flag, and not the busy > > > bitmask. Attachment contains patch. > > > > Hang on. I just checked the patch and it doesn't increment m->busy. The > > original call before I put in the atomic arithmetic macros was > > 'm->busy++'. After your patch it would change to 'm->flags |= PG_BUSY' > > which is very different. > > > I agree that it is different, but PAGE_BUSY was originally > m->flags |= PG_BUSY. I have been trying to merge in my VM updates, > and the change in definition had caused some confusion. (And this > along with some other changes is why my published patches don't > work on -current.) I understand now after reading an old version of your VM patch. I added the macro PAGE_BUSY to encapsulate manipulations of m->busy and you added PAGE_BUSY to set the PG_BUSY bit. I think we need two macros :-). I don't mind changing the m->busy++ one; what do you think is the right name? > > It is correct as-is, considering how it is being used. Sorry. > (Note my misuse of 'busy bitmask', and not 'busy count' -- that > was incorrect.) > > I believe that there are some problems (windows) with wakeups > on both m->busy and PG_BUSY. IMO, it is probably wisest to > wakeup on decrementing m->busy to zero, or clearing PG_BUSY, > whenever PG_WANTED is set. > > So, > PAGE_BWAKEUP would decr busy, and wakeup if PG_WANTED > and busy == 0. > > PAGE_WAKEUP would clear PG_BUSY, and wakeup if PG_WANTED. > > Each of the above would ignore the other condition. There will > be extra wakeups, but those won't significantly affect performance. > It is possible for one to wait on one or both conditions, so > waking up on either is the right way. I was in error when I > forced a wakeup criteria of *both* conditions. I don't understand this part of the code of the code very well. It doesn't seem to me that a few extra wakeups is a problem. Not waking up at all is a problem... -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 951 1891 Fax: +44 181 381 1039 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message