[lkml]   [2001]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: VM in 2.4.7-pre hurts...

On Sat, 7 Jul 2001, Rik van Riel wrote:
> Not at all. Note that try_to_swap_out() will happily
> create swap cache pages with a very high page->age,
> pages which are in absolutely no danger of being
> evicted from memory...

That seems to be a bug in "add_to_swap_cache()".

In fact, I do not see any part of the whole path that sets the page age at
all, so we're basically using a completely uninitialized field here (it's
been initialized way back when the page was allocated, but because it
hasn't been part of the normal aging scheme it has only been aged up,
never down, so the value is pretty much random by the time we actually add
it to the swap cache pool).

Suggested fix:

--- v2.4.6/linux/mm/swap_state.c Tue Jul 3 17:08:22 2001
+++ linux/mm/swap_state.c Sat Jul 7 11:49:13 2001
@@ -81,6 +81,7 @@
flags = page->flags & ~((1 << PG_error) | (1 << PG_arch_1));
page->flags = flags | (1 << PG_uptodate);
+ page->age = PAGE_AGE_START;
add_to_page_cache_locked(page, &swapper_space, entry.val);

Does that make a difference for people?

That would certainly help explain why aging doesn't work for some people.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 12:56    [W:0.034 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site