lkml.org 
[lkml]   [2009]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectmadvise failure
In an application something like
p = mmap(0, sz, PROT_READ, MAP_PRIVATE, fd, 0);
madvise(p, sz, MADV_SEQUENTIAL);
is done for a small number of files, each with a size of a few GB.
A single sequential pass is done over these files - essentially a merge.

On an old machine the madvise is useful, and decreases total time.
But on a more recent machine, with more memory, the madvise makes
things worse. There, it seems better not to reveal to the kernel
that the data will be read sequentially.

Timing (six files of 4GB each, quadcore Intel Q9550, 16GB memory,
kernel 2.6.27 [Ubuntu], two other processes active):
with madvise, 7 runs: real time varying 9m10s - 37m29s,
without madvise, 6 runs: real time fairly constant 5m45s - 5m54s.


Andries



\
 
 \ /
  Last update: 2009-05-07 14:47    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site