Date: Tue, 25 Aug 1998 10:11:36 +0100 (BST) From: Doug Rabson <dfr@nlsystems.com> To: "John S. Dyson" <dyson@iquest.net> Cc: current@FreeBSD.ORG Subject: Re: Serious bug in vm_page.h in current Message-ID: <Pine.BSF.4.01.9808251006570.17263-100000@herring.nlsystems.com> In-Reply-To: <199808250840.DAA00444@dyson.iquest.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9808251006570.17263-100000>