public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mmapping large files hits swap in 2.4?
@ 2002-08-09 17:26 Daniel Egger
  2002-08-10 12:12 ` Richard Zidlicky
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Egger @ 2002-08-09 17:26 UTC (permalink / raw)
  To: linux-kernel

Hija,

I'm currently looking into optimizing GIMPs own swapping algorithm
by replacing naive file operations by mmap-based ones. Unfortunately
my test machine (PPC, 256MB) gets hit really hard by mmapping files over
100MB into memory: The swap utilization grows up to the file size
and the machine is completely unresponsive for several seconds up to
a few minutes. Seemingly the writes to the mmaped area first hit the
swap and then are read from there again to fit the designated file.

I'm doing something along the lines of:
area = mmap (0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

I also tried MAP_PRIVATE and MAP_LOCKED both with a private and a
shared mapping, but to no avail.

This is kernel version 2.4.19-rc3 (in the benh-variant).

Is there anything I can do to improve the situation or is it just 
the kernel or the architecture?

-- 
Servus,
       Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <Pine.LNX.4.33.0208101437380.838-100000@coffee.psychology.mcmaster.ca>]

end of thread, other threads:[~2002-08-12 11:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-09 17:26 mmapping large files hits swap in 2.4? Daniel Egger
2002-08-10 12:12 ` Richard Zidlicky
2002-08-10 16:17   ` Daniel Egger
2002-08-10 23:13     ` Richard Zidlicky
     [not found] <Pine.LNX.4.33.0208101437380.838-100000@coffee.psychology.mcmaster.ca>
2002-08-10 22:19 ` Daniel Egger
2002-08-12  9:11   ` Helge Hafting
2002-08-12 11:41     ` Daniel Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox