lkml.org 
[lkml]   [1998]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Magic in swap code. :-)
> I am not a kernel hacker but a read carefully this thread about swap
> performence...
> And I have a idea, don't know if it is good or bad so here it is as is :
>
> Lets implement a state of kswap where it tries to pre-swap a page,
> to pre-swap a page is just put it on disk mark it in the page structure
> as being on disk but KEEP it in memory.

This is how swap cache works :-)


Werner

>
> So after a while most of the main memory should be pre-swapped ie on disk.
> When the system needs memory : just go through the page structure and
> free pages according to whatever algo you want and swap it out,
> as pages are already on disk you just need to mark in NOT IN MEMORY
> and that's all.
> Of course you have to be sure that the page pre-swapped is really the
> same as the page in memory... (maybe this is the hard part)
> If you access a pre-swapped page in write mode mark it as DIFFERENT from
> the pre-swapped image and free the pre-swapped image.
> This way kswap should to most of its disk activity when the system is idle
> and keep the maximum of pages in memory but ready to be freed...
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.095 / U:1.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site