Re: Page cache and swapping

Krzysztof Strasburger (
Thu, 26 Jun 97 13:42

>> The patch allows removing shared pages from page cache and removes setting
>> of the referenced bit for all shared pages.

>I'm sorry, but this can't work. There is no such thing as a "shared unused"
>page. I suppose you mean "not referenced" by "unused".
Sure, you are right. I mean "not referenced".
>Still, your patch doesn't work. You need to guarantee that the page you
>are freeing is not in any process page tables. Otherwise, a process could
>reference the page after you have freed it. This is usually done by
>try_to_swap_out which will in turn remove the page from the memory map of
>every process that contains it. After that, it can be freed.
Sounds judiciously, but I have still two questions.
1. If page->count = 1 and the page is in page cache, it belongs exactly
to one process. Right? Why is it simply freed by shrink_mmap and why
it can't be freed, if page->count > 1?. Where is it removed from the process
page table? Or rather the "present" bit is set to zero for page cache
2. Why my computer works with this patch? It should crash. Or at least
programs should terminate very quickly ;-)