From: Hugh Dickins <hugh@veritas.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Daniel Drake <ddrake@brontes3d.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: speeding up swapoff
Date: Wed, 29 Aug 2007 16:58:01 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0708291638550.30229@blonde.wat.veritas.com> (raw)
In-Reply-To: <20070829073040.1ec35176@laptopd505.fenrus.org>
On Wed, 29 Aug 2007, Arjan van de Ven wrote:
> On Wed, 29 Aug 2007 09:29:32 -0400
> Daniel Drake <ddrake@brontes3d.com> wrote:
>
> > I've spent some time trying to understand why swapoff is such a slow
> > operation.
> >
> > My experiments show that when there is not much free physical memory,
> > swapoff moves pages out of swap at a rate of approximately 5mb/sec.
>
> sounds like about disk speed (at random-seek IO pattern)
The present method should be reading sequentially (with gaps),
rather than randomly. Perhaps we need to check what's happening
in practice.
(I've often dithered over whether we should be doing swap readahead
there or not: at present it does not, preferring to assume buffering
at the hardware level, and last time I checked that worked out a
little better.)
> Another question, if this is during system shutdown, maybe that's a
> valid case for flushing most of the pagecache first (from userspace)
> since most of what's there won't be used again anyway. If that's enough
> to make this go faster...
(I didn't understand your point there, but Daniel has replied that
it's not at shutdown anyway.)
> A third question, have you investigated what happens if a process gets
> killed that has pages in swap; as long as we don't page those in but
> just forget about them, that would solve the shutdown problem nicely
> (since we kill stuff first anyway there)
We definitely don't page those in, it would be a disaster for process
exit if we did: they just get discarded.
As you say, shutdown is rarely a big issue, because almost all the
processes which had stuff in swap have already been killed. tmpfs
use of swap can be an issue there, but if the distro is wise, it'll
do things in such an order that tmpfs'es are unmounted before swapoff
(but may need two passes: the opposite case is a regular swapfile,
where we need to swapoff before that partition can be unmounted).
Hugh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-08-29 15:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-29 13:29 Daniel Drake
2007-08-29 14:30 ` Arjan van de Ven
2007-08-29 14:36 ` Oliver Neukum
2007-08-29 16:04 ` Hugh Dickins
2007-08-29 16:18 ` Oliver Neukum
2007-08-29 14:44 ` Daniel Drake
2007-08-29 15:12 ` Juergen Beisert
2007-08-30 15:57 ` Bill Davidsen
2007-09-01 22:20 ` Andi Kleen
2007-08-29 15:58 ` Hugh Dickins [this message]
2007-08-29 15:36 ` Hugh Dickins
2007-08-30 8:27 ` Eric W. Biederman
2007-08-30 10:36 ` Hugh Dickins
2007-08-30 15:05 ` Daniel Drake
2007-08-29 16:08 ` Lee Schermerhorn
[not found] <fa.j/pO3mTWDugTdvZ3XNr9XpvgzPQ@ifi.uio.no>
[not found] ` <fa.ed9fasZXOwVCrbffkPQTX7G3a7g@ifi.uio.no>
[not found] ` <fa./NZA3biuO1+qW5pW8ybdZMDWcZs@ifi.uio.no>
2007-08-30 1:37 ` Robert Hancock
2007-08-30 13:55 ` Helge Hafting
2007-08-30 14:06 ` Xavier Bestel
2007-08-30 14:06 ` Helge Hafting
2007-08-30 14:14 ` Xavier Bestel
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=Pine.LNX.4.64.0708291638550.30229@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=arjan@infradead.org \
--cc=ddrake@brontes3d.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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