Re: VM questions

From: Juan J. Quintela (quintela@fi.udc.es)
Date: Fri May 26 2000 - 12:02:38 EST


>>>>> "james" == James Wilson <jwilson@cmu.edu> writes:

james> I'm working on a research project that involves some kernel hacking --
james> this is my experience with the linux kernel. A few questions:

james> In swapin_readadead (mm/memory.c):

james> new_page = read_swap_cache_async(SWP_ENTRY(SWP_TYPE(entry), offset), 0);
james> if (new_page != NULL)
james> __free_page(new_page);

if you read the 2.3.99-pre{9,10} code you see that the function change
to:
                if (new_page != NULL)
                        page_cache_release(new_page);
It is the same code, but it looks more sane. The reason of that
page_cache_release is that we do one page_cache_get(page) in
__find_page_nolock to evict somebody else removing the page while we
are playing with it. (See the call chain).

james> Seems like we are freeing a page just after allocating/reading it! There
james> must be a reason for this, can someone supply it?

Read previous statement, if you need a more detailed explanation ask
again. The problem is that __free_page only frees the page if the
page count is zero.

james> Also, the swapin hook operation that was used by do_swap_page
james> (mm/memory.c) seems to have vanished in the 2.3.10 patch. Any reason why
james> this was done?

Which hook? There still a call to swaping_readahead from do_swap_page.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

- 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/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:16 EST