Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 1998 03:40:02 -0500 (EST)
From:      "John S. Dyson" <dyson@iquest.net>
To:        dfr@nlsystems.com (Doug Rabson)
Cc:        dyson@iquest.net, current@FreeBSD.ORG
Subject:   Re: Serious bug in vm_page.h in current
Message-ID:  <199808250840.DAA00444@dyson.iquest.net>
In-Reply-To: <Pine.BSF.4.01.9808250859110.17263-100000@herring.nlsystems.com> from Doug Rabson at "Aug 25, 98 09:01:43 am"

next in thread | previous in thread | raw e-mail | index | archive | help
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.)

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.

-- 
John                  | Never try to teach a pig to sing,
dyson@iquest.net      | it makes one look stupid
jdyson@nc.com         | and it irritates the pig.

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?199808250840.DAA00444>