* shrink_mmap ()?
@ 1998-03-26 12:34 Chirayu Patel
1998-03-26 13:09 ` Rik van Riel
0 siblings, 1 reply; 2+ messages in thread
From: Chirayu Patel @ 1998-03-26 12:34 UTC (permalink / raw)
To: linux-mm, linux-kernel
Hi,
I was going through the source for shrink_mmap.......
The attached code puzzled me..
We are freeing a page with count = 1 (referenced by one process only) but
we are not manipulating any page table entries. Why? Shouldnt we be
manipulating the page table entries or where are the page table entries
getting manipulated?
I know I have missed something terribly obvious over here. Can someone
please help me out.
Thanks.
-- Chirayu
-----------------------------------------------------------------------
switch (atomic_read(&page->count)) {
case 1:
/* is it a swap-cache or page-cache page? */
if (page->inode) {
if (test_and_clear_bit(PG_referenced,
&page->flags)) {
touch_page(page);
break;
}
age_page(page);
if (page->age)
break;
if (PageSwapCache(page)) {
delete_from_swap_cache(page);
return 1;
}
remove_page_from_hash_queue(page);
remove_page_from_inode_queue(page);
__free_page(page);
return 1;
}
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: shrink_mmap ()?
1998-03-26 12:34 shrink_mmap ()? Chirayu Patel
@ 1998-03-26 13:09 ` Rik van Riel
0 siblings, 0 replies; 2+ messages in thread
From: Rik van Riel @ 1998-03-26 13:09 UTC (permalink / raw)
To: Chirayu Patel; +Cc: linux-mm, linux-kernel
On Thu, 26 Mar 1998, Chirayu Patel wrote:
> I was going through the source for shrink_mmap.......
>
> We are freeing a page with count = 1 (referenced by one process only) but
> we are not manipulating any page table entries. Why? Shouldnt we be
> manipulating the page table entries or where are the page table entries
> getting manipulated?
>
> I know I have missed something terribly obvious over here. Can someone
> please help me out.
When the count is 1, the page cache _is_ the only reference to
the page.
Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page | Scouting webmaster |
| - kswapd ask-him & complain-to guy | Vries cubscout leader |
| http://www.fys.ruu.nl/~riel/ | <H.H.vanRiel@fys.ruu.nl> |
+-------------------------------------------+--------------------------+
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-03-26 13:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-26 12:34 shrink_mmap ()? Chirayu Patel
1998-03-26 13:09 ` Rik van Riel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox