Re: An idea for prefetching swapped memory...

Mark Mielke (mark@mark.mielke.cc)
Mon, 7 Apr 2003 15:35:34 -0400


On Mon, Apr 07, 2003 at 02:49:10PM -0400, Chris Friesen wrote:
> Mark Mielke wrote:
> >On Mon, Apr 07, 2003 at 10:19:25AM -0400, Chris Friesen wrote:
> >Chris: Based on your usage patterns, how would Linux know that you were
> >going to be opening up Mozilla, and not that you were going to tweak the
> >kernel source and compile it again?
> Because it would read my mind and figure out what I wanted! ;-)

Oooo... I want this OS! :-)

> Maybe it would be possible to have some way to tell the kernel, "I would
> prefer this process to be in memory, unless you're running short, at which
> point you can swap it out."

> This would be very similar to the niceness value, except it would control
> what memory gets swapped out. You could tie it in to what processes have
> been running, such that if the system goes idle you could start
> preferentially swapping back in the processes with the memory niceness set.
> If you left it at zero you get the current behaviour (not swapped in until
> needed) while positive (or negative, to align with niceness) values would
> swap that process in preferentially when the system goes idle.

> This would give similar benefits as mlock without actually robbing the
> kernel of the ability to swap out under memory pressure.

> Does this sound at all useful, or am I blowing smoke?

I think it could be useful, but is probably much more complicated in the
details... Like, for example, how would you know whether a file page in
memory had been used by only one process, or many, and what priority it
should have? What happens if the scheme conflicts with the LRU scheme?
What happens if the memory page is really a shared memory segment used
by both the application and X to double-buffer display the window?

Implementation of this is beyond my imagination today... I only see perils.

mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them...

http://mark.mielke.cc/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/