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

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

----==-- _
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ /
-=====/_/_//_/\_,_/ /_/\_\
The choice of a GNU generation

 \ /
  Last update: 2005-03-22 13:39    [W:0.111 / U:5.284 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site