From: Stephen Tweedie <sct@redhat.com>
To: Richard Jerrell <jerrell@missioncriticallinux.com>
Cc: linux-kernel@vger.kernel.org, Rik van Riel <riel@nl.linux.org>,
Stephen Tweedie <sct@redhat.com>
Subject: Re: [PATCH] mm/memory.c, 2.4.1 : memory leak with swap cache (updated)
Date: Mon, 26 Mar 2001 15:26:25 +0100 [thread overview]
Message-ID: <20010326152625.A1165@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0103221716460.20061-200000@jerrell.lowell.mclinux.com>
In-Reply-To: <Pine.LNX.4.21.0103221716460.20061-200000@jerrell.lowell.mclinux.com>; from jerrell@missioncriticallinux.com on Thu, Mar 22, 2001 at 05:21:46PM -0500
Hi,
On Thu, Mar 22, 2001 at 05:21:46PM -0500, Richard Jerrell wrote:
> 2.4.1 has a memory leak (temporary) where anonymous memory pages that have
> been moved into the swap cache will stick around after their vma has been
> unmapped by the owning process. These pages are not free'd in free_pte()
> because they are still referenced by the page cache. In addition, if the
> pages are dirty, they will be written out to the swap device before they
> are reclaimed even though the owning process no longer will be using the
> pages.
>
> free_pte in mm/memory.c has been modified to check to see if the page is
> only being referenced by the swap cache (and possibly buffers).
But is it worth it?
fork and exit are very hot paths in the kernel, and this patch can force
a page cache lookup on a large number of pte which wouldn't be looked
up before.
The classic case is sendmail or apache, where you can have a parent
process rapidly forking a large number of children. If part of the
parent gets swapped out due to lack of use, then the children all
inherit swapped ptes and each such page will result in an extra page
cache lookup in zap_page_range on exit with this change.
Given that the leak is, as you say, temporary, and that the leak will
be recovered as soon as we start swapping again, do we really want to
pollute the fast path for the sake of a bit more speed during
swapping?
Cheers,
Stephen
next prev parent reply other threads:[~2001-03-27 16:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-22 22:21 [PATCH] mm/memory.c, 2.4.1 : memory leak with swap cache (updated) Richard Jerrell
2001-03-22 23:16 ` Rik van Riel
2001-03-23 16:32 ` Richard Jerrell
2001-03-23 11:21 ` Rik van Riel
2001-03-26 14:26 ` Stephen Tweedie [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-03-27 21:29 Richard Jerrell
2001-03-27 21:18 ` Rik van Riel
2001-03-27 23:10 ` Richard Jerrell
2001-03-27 22:57 ` Rik van Riel
2001-03-27 21:51 ` Linus Torvalds
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=20010326152625.A1165@redhat.com \
--to=sct@redhat.com \
--cc=jerrell@missioncriticallinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@nl.linux.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