Skip to contentSkip to conversation

2.4.19 ( try_to_swap_out) does not set page->mapping to NULL

DISCUSSION Bourne 1 participant 1 message Dec 12, 2002

lore
Share & tools
lore

Bourne

author
#0 lore raw

Hi all, A small piece of code in mm/vmscan.c kept me confused. Please could some one explain this ?

File: mm/vmscan.c , try_to_swap_out()

....SNIP....
drop_pte: mm->rss--

               UnlockPage(page);
               ---SNIP--
               page_cache_release(page);
               return freeable;
               ----SNIP----

if(page->mapping)
goto drop_pte;

What i can get is if page->mapping is NOT NULL , then do a page_cache_release(). This boils down to __free_pages_ok(). Here the code snippet is if(page->mapping) BUG();

So if try_to_swap_out wants to drop a page which can be brought in always ( i.e , not dirty ), then what is the harm in setting it to NULL ?

TIA

Bourne