Mailing List Archive

swapout and pte_young() PG_referenced
I can see why we return 0 and we mark the page old in the swapout young
case.
But I can't see how can be useful marking the page PG_referenced before
return 0 if the page is young. It's not a swap cache page, it's not a
freeable page and shrink_mmap() can do nothing with it.
if (pte_young(pte)) {
/*
* Transfer the "accessed" bit from the page
* tables to the global page map.
*/
set_pte(page_table, pte_mkold(pte));
set_bit(PG_referenced, &page_map->flags);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return 0;
}
Am I missing something again ? ;)
Andrea Arcangeli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: swapout and pte_young() PG_referenced [ In reply to ]
Hi,
On Fri, 15 Jan 1999 17:37:00 +0100 (CET), Andrea Arcangeli
<andrea@e-mind.com> said:
> I can see why we return 0 and we mark the page old in the swapout young
> case.
> But I can't see how can be useful marking the page PG_referenced before
> return 0 if the page is young. It's not a swap cache page, it's not a
> freeable page and shrink_mmap() can do nothing with it.
> Am I missing something again ? ;)
Yes. We might well have released the page before shrink_mmap() next
comes around to it. Think about a binary which exits and is respawned.
We want any usage information (the PG_referenced bit) to survive the
exit() so that it is not immediately evicted from cache once the process
exits and shrink_mmap starts taking an interest in it.
--Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: swapout and pte_young() PG_referenced [ In reply to ]
On Tue, 19 Jan 1999, Stephen C. Tweedie wrote:
> > But I can't see how can be useful marking the page PG_referenced before
> > return 0 if the page is young. It's not a swap cache page, it's not a
> > freeable page and shrink_mmap() can do nothing with it.
>
> > Am I missing something again ? ;)
>
> Yes. We might well have released the page before shrink_mmap() next
> comes around to it. Think about a binary which exits and is respawned.
> We want any usage information (the PG_referenced bit) to survive the
> exit() so that it is not immediately evicted from cache once the process
> exits and shrink_mmap starts taking an interest in it.
Ah cool! Thanks. I didn't though at it.
Andrea Arcangeli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/