From: Helge Hafting <helgehaf@aitel.hist.no>
To: Roy Sigurd Karlsbakk <roy@karlsbakk.net>
Cc: Kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: lilo/raid?
Date: Wed, 03 Jul 2002 11:43:17 +0200 [thread overview]
Message-ID: <3D22C735.7A5F299A@aitel.hist.no> (raw)
In-Reply-To: 200207021333.36435.roy@karlsbakk.net
Roy Sigurd Karlsbakk wrote:
> I've seen it. 1GB of swap for caching heavy downloads (se earlier thread 'VM
> fsckup' or somehting)
>
> What is the reason of using swap for cache buffers?????
To be precise - swap is never used _for_ cache buffers - you'll
never see file contents in the swap partition, perhaps with
the exception of tmpfs stuff.
But aggressive caching may indeed push other stuff into swap,
typically little-used program memory.
The balance is probably off, but the feature is a good one.
The point is to minimize disk waiting by ensuring that
often-used stuff is in memory, possibly pushing seldom-used
stuff into swap.
Some workload results in some files being accessed a lot,
such as the homepage files for a webserver. Caching them
makes sense then, even if some little-used sleeping
program is pushed into swap. It is used less than those
often-used files, so recovering it from swap when it
eventually is needed results in less total waiting
than what you get if every web server access hits the disk.
The balance being off have several explanations:
1. People don't _expect_ to wait for paging activity, while
they expect having to wait for the disk.
2. Selecting wich pages to keep and which to swap (or
not cache if it is a data file) is hard.
The reverse mapping VM will limit the unnecessary swapping,
making the best decision is sometimes impossible without
it, or at least much harder.
3. The problem is still hard, even with rmap. That's because
we don't know how files and executables will be used in
the future. All we have to make the decision is statistics
about previous use.
Allowing applications to give the kernel hints may help,
but giving good hints may be hard, and the potential
for abuse is there. (App gives unrealistic hints -
and seems more snappy than the competition. And lots
of other processes suffer.) This is avoidable by only
allowing negative hints, i.e. "Don't bother caching this"
You probably agree that it makes sense to swap out
program initialization code that won't be used
again once the program is up and running. The problem is
that the VM system can't identify such code other than
by the fact that it is a long time since the last use.
Helge Hafting
next prev parent reply other threads:[~2002-07-03 9:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-01 14:04 lilo/raid? Roy Sigurd Karlsbakk
2002-07-01 15:52 ` lilo/raid? Bill Davidsen
2002-07-01 16:02 ` lilo/raid? Roy Sigurd Karlsbakk
2002-07-01 18:36 ` lilo/raid? Bill Davidsen
2002-07-01 15:59 ` lilo/raid? Andries Brouwer
2002-07-01 16:15 ` lilo/raid? Roy Sigurd Karlsbakk
2002-07-01 15:59 ` lilo/raid? Zwane Mwaikambo
2002-07-02 8:16 ` lilo/raid? Helge Hafting
2002-07-02 9:12 ` lilo/raid? Zwane Mwaikambo
2002-07-02 10:26 ` lilo/raid? jw schultz
2002-07-02 10:28 ` lilo/raid? Jakob Oestergaard
2002-07-02 11:33 ` lilo/raid? Roy Sigurd Karlsbakk
2002-07-03 9:43 ` Helge Hafting [this message]
2002-07-03 10:02 ` lilo/raid? Roy Sigurd Karlsbakk
2002-07-02 11:27 ` lilo/raid? Roy Sigurd Karlsbakk
2002-07-01 16:05 ` lilo/raid? Fabio Massimo Di Nitto
2002-07-01 16:07 ` lilo/raid? Roy Sigurd Karlsbakk
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=3D22C735.7A5F299A@aitel.hist.no \
--to=helgehaf@aitel.hist.no \
--cc=linux-kernel@vger.kernel.org \
--cc=roy@karlsbakk.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.