Subject: Re: pmap_is_referenced() -- not used?
To: None <thorpej@zembu.com>
From: Lars Heidieker <paradoxix@heidieker.de>
List: tech-kern
Date: 01/26/2001 19:26:42
Jason R Thorpe wrote:

> On Fri, Jan 26, 2001 at 06:30:42PM +0100, Lars Heidieker wrote:
>
>  > Sure, but why would you leave a page on the active queue (quiet near the
>  > front) if its referenced, to scan it again on the next invocation of the
>  > scanner? By this you scan the front of the list to hard. (Not giving a
>
> Remember, the scanner doesn't run constantly -- the scanner only runs when
> there is memory pressure.
>
> If it's referenced, you want to "wait a while" to check if it's referenced
> again.  If you're:
>
>         1 -> 2 -> 3 -> 4 -> 5 -> 6
>                        |
>                    check ref
>         1 -> 2 -> 3 -> 5 -> 6 -> 4
>

But if the inactive target is met after scanning page 5 or 6 the scanner would
start at the beginning of the queue and that time pageframe 4 would by at a maximum
distant. The Question is does the scanner stop the current invocation before the
moved page (4) is scanned again?
If it stops than this referenced page will be scanned at point that is more in the
future, as the scanner does not run constantly and it will always start at the
beginning of the list on invocation.

>
> ...then you're going to scan 4 again too soon, and move it to the inactive
> list prematurely.  You're also going to create more work for yourself by
> giving yourself more pages to scan.  You could get into an infinite loop
> if you have lots of frequently access pages on an MP system.
>
>  > referenced page a chance to get referenced again between two invocations of
>  > the scanner) Recently referenced pages at the front might be forced to the
>  > inactive list even if there are "not so recently used ones" further on in the
>  > queue. Thats the way it looks to me. In both cases it can happen that all
>  > pages on the active queue are referenced, so you have to scan across all of
>  > them twice (in any case) and the scanner always starts at the front at
>  > invocation.
>
> Yes, but remember, in my patch, pages on the inactive list can *also* be
> referenced, because I do not revoke thier mappings.  So if one of those
> recently access pages at the head of the list is moved to inactive list,
> it's okay.
>
> --
>         -- Jason R. Thorpe <thorpej@zembu.com>

Fair point I have my system changed the way that pages can be referenced on the
inactive queue, I think thats important. I see the race on MP-systems where th
scanner could be catch in an loop by an othe processor/precess doing the "right"
references.

And if the mappings of inactive pages are not revoke (which is absolutly the right
way) reactivating pages is a lot cheaper than the old way, where probably memory
was needed for pagetables and that stressed the memory load even more.

lars