lkml.org 
[lkml]   [1997]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Page cache and swapping
Date

1. to the one saying qsort'ing mmaped file would be agood idea:

if you qsort a file that does not fit in memory, your program
is nearly broken - qsort has almost no locality, so you
get what you deserve... slow performance. qsort is one
of the worst sorting algorithms for this case.

>> 1. If page->count = 1 and the page is in page cache, it belongs exactly
>> to one process. Right? Why is it simply freed by shrink_mmap and why
>> it can't be freed, if page->count > 1?. Where is it removed from the process
>> page table? Or rather the "present" bit is set to zero for page cache
>> pages.
>This is the difficult point - you need to walk the page tables of all
>processes to find out which ones are using the page - a very costly
>operation. This is why the current system doesn't do this.

One point: when linux has started swapping, you have 50-95% IDLE time,
because almost NO process can run. In this (quite normal scenario), you
*do* have quite enough time to do almost any operation you want.

Imagine the time it needs to write a single page to swap.. in that time
you can do many thousands of memory accesses - and would still
be faster when only saving ONE page form swapping.

---------------------------------------------------------------------
for a pentium-optimizing gcc, look at http://www.goof.com/pcg

-----==-
----==-- _
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / mlehmann@hildesheim.sgh-net.de
-=====/_/_//_/\_,_/ /_/\_\ pcg@goof.com
The choice of a GNU generation
\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.054 / U:0.528 seconds]
©2003-2014 Jasper Spaans. Advertise on this site