From: Richard Zidlicky <rz@linux-m68k.org>
To: Daniel Egger <degger@fhm.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mmapping large files hits swap in 2.4?
Date: Sat, 10 Aug 2002 14:12:01 +0200 [thread overview]
Message-ID: <20020810141201.A1868@linux-m68k.org> (raw)
In-Reply-To: <1028913975.3832.14.camel@sonja.de.interearth.com>; from degger@fhm.edu on Fri, Aug 09, 2002 at 07:26:14PM +0200
On Fri, Aug 09, 2002 at 07:26:14PM +0200, Daniel Egger wrote:
> 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);
seems like you are doing something else, like hitting all
of the file.
# uname -a
Linux sirizidl.dialin.rrze.uni-erlangen.de 2.4.18 #27 Wed Jul 24 17:25:39 CEST 2002 m68k unknown
main()
{
char *area;
int fd=open("/msrc/linux/distr/cd.image", O_RDWR);
area = mmap (0, 168088*4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (area == -1) perror("mmap");
}
# time ./mmap
real 0m0.035s
user 0m0.020s
sys 0m0.020s
Richard
next prev parent reply other threads:[~2002-08-10 13:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-09 17:26 mmapping large files hits swap in 2.4? Daniel Egger
2002-08-10 12:12 ` Richard Zidlicky [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020810141201.A1868@linux-m68k.org \
--to=rz@linux-m68k.org \
--cc=degger@fhm.edu \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox