From: "Stephen C. Tweedie" <sct@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
"David S. Miller" <davem@redhat.com>,
Rik van Riel <riel@conectiva.com.br>,
Marcelo Tosatti <marcelo@conectiva.com.br>,
linux-mm@kvack.org
Subject: Re: Subtle MM bug
Date: Mon, 8 Jan 2001 18:10:28 +0000 [thread overview]
Message-ID: <20010108181028.F9321@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.10.10101080916180.3750-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Mon, Jan 08, 2001 at 09:29:15AM -0800
On Mon, Jan 08, 2001 at 09:29:15AM -0800, Linus Torvalds wrote:
> On Mon, 8 Jan 2001, Stephen C. Tweedie wrote:
> If you have a well-behaving application that doesn't even have memory
> pressure, but fills up >50% of memory in its VM, nothing will actually
> happen in the steady state. It can have 99% of available memory, and not a
> single soft page fault.
Agreed, but that's not how I read your statement about scanning the VM
regularly. The problem happens if you are working happily with enough
free memory and you suddenly need a large amount of allocation: having
some relatively uptodate page age information may give you a _much_
better idea of what to page out.
Rik was going to experiment with this --- Rik, do you have any hard
numbers for the benefit of maintaining a background page aging task?
> But think about what happens if you now start up another application? And
> think about what SHOULD happen. The 50% ruls is perfectly fine:
Right, I interpreted your 50% as a steady-state limit.
> Stephen: have you tried the behaviour of a working set that is dirty in
> the VM's and slightly larger than available ram? Not pretty.
Yes, and this is something that Marcelo's swap clustering code ought
to be ideal for.
> _really_ well on many loads, but this one we do badly on. And from what
> I've been able to see so far, it's because we're just too damn good at
> waiting on page_launder() and doing refill_inactive_scan().
do_try_to_free_pages() is trying to
/*
* If needed, we move pages from the active list
* to the inactive list. We also "eat" pages from
* the inode and dentry cache whenever we do this.
*/
if (free_shortage() || inactive_shortage()) {
shrink_dcache_memory(6, gfp_mask);
shrink_icache_memory(6, gfp_mask);
ret += refill_inactive(gfp_mask, user);
} else {
So we're refilling the inactive list regardless of its current size
whenever free_shortage() is true. In the situation you describe,
there's no point refilling the inactive list too far beyond the
ability of the swapper to launder it, regardless of whether
free_shortage() is set.
refill_inactive contains exactly the opposite logic: it breaks out if
/*
* If we either have enough free memory, or if
* page_launder() will be able to make enough
* free memory, then stop.
*/
if (!inactive_shortage() || !free_shortage())
goto done;
but that still means that we're doing unnecessary inactive list
refilling whenever free_shortage() is true: this test only occurs
after we've tried at least one swap_out(). We're calling
refill_inactive if either condition is true, but we're staying inside
it only if both conditions are true.
Shouldn't we really just be making the refill_inactive() here depend
on inactive_shortage() alone, not free_shortage()? By refilling the
inactive list too agressively we actually end up discarding aging
information which might be of use to us.
Rik, any thoughts? This looks as if it's destroying any hope of
maintaining the intended inactive_shortage() targets.
--Stephen
--
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.eu.org/Linux-MM/
next prev parent reply other threads:[~2001-01-08 18:10 UTC|newest]
Thread overview: 128+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200101080602.WAA02132@pizda.ninka.net>
2001-01-08 6:42 ` Subtle MM bug Linus Torvalds
2001-01-08 13:11 ` Marcelo Tosatti
2001-01-08 16:42 ` Rik van Riel
2001-01-08 17:43 ` Linus Torvalds
2001-01-08 13:57 ` Stephen C. Tweedie
2001-01-08 17:29 ` Linus Torvalds
2001-01-08 18:10 ` Stephen C. Tweedie [this message]
2001-01-08 21:52 ` Marcelo Tosatti
2001-01-09 0:28 ` Linus Torvalds
2001-01-08 23:49 ` Marcelo Tosatti
2001-01-09 3:12 ` Linus Torvalds
2001-01-09 20:33 ` Marcelo Tosatti
2001-01-09 22:44 ` Linus Torvalds
2001-01-09 21:33 ` Marcelo Tosatti
2001-01-09 22:11 ` Yet another bogus piece of do_try_to_free_pages() Marcelo Tosatti
2001-01-10 0:06 ` Linus Torvalds
2001-01-10 6:39 ` Marcelo Tosatti
2001-01-10 22:19 ` Roger Larsson
2001-01-11 0:11 ` Zlatko Calusic
2001-01-17 6:58 ` Rik van Riel
2001-01-17 6:07 ` Marcelo Tosatti
2001-01-17 19:04 ` Zlatko Calusic
2001-01-17 19:22 ` Ingo Molnar
2001-01-18 0:55 ` Rik van Riel
2001-01-17 6:52 ` Rik van Riel
2001-01-09 23:58 ` Subtle MM bug Linus Torvalds
2001-01-09 22:21 ` Marcelo Tosatti
2001-01-10 0:23 ` Linus Torvalds
2001-01-10 0:12 ` Marcelo Tosatti
2001-01-10 11:29 ` Stephen C. Tweedie
2001-01-11 3:30 ` Marcelo Tosatti
2001-01-11 9:42 ` Stephen C. Tweedie
2001-01-11 15:24 ` Marcelo Tosatti
2001-01-17 4:54 ` Rik van Riel
2001-01-08 16:45 ` Rik van Riel
2001-01-08 17:50 ` Linus Torvalds
2001-01-08 18:21 ` Rik van Riel
2001-01-08 18:38 ` Linus Torvalds
2001-01-10 19:57 Chris Wing
-- strict thread matches above, loose matches on Subject: below --
2001-01-08 20:39 Szabolcs Szakacsits
2001-01-08 21:56 ` Wayne Whitney
2001-01-08 23:22 ` Wayne Whitney
2001-01-08 23:30 ` Andrea Arcangeli
2001-01-09 0:37 ` Linus Torvalds
2001-01-08 22:00 ` Wayne Whitney
2001-01-08 22:15 ` Andrea Arcangeli
2001-01-08 5:29 Wayne Whitney
2001-01-08 5:42 ` Andi Kleen
2001-01-08 6:04 ` Linus Torvalds
2001-01-08 17:44 ` Rik van Riel
2001-01-08 18:02 ` Linus Torvalds
2001-01-08 17:16 ` Rik van Riel
2001-01-08 17:58 ` Linus Torvalds
2001-01-08 23:41 ` Zlatko Calusic
2001-01-09 2:58 ` Linus Torvalds
2001-01-09 6:20 ` Eric W. Biederman
2001-01-09 7:27 ` Linus Torvalds
2001-01-09 11:38 ` Eric W. Biederman
2001-01-09 12:29 ` Zlatko Calusic
2001-01-09 18:47 ` Linus Torvalds
2001-01-09 19:09 ` Daniel Phillips
2001-01-09 19:29 ` Trond Myklebust
2001-01-10 17:32 ` Andi Kleen
2001-01-10 19:31 ` Alan Cox
2001-01-10 19:33 ` Andi Kleen
2001-01-10 19:40 ` Alan Cox
2001-01-10 19:43 ` Andi Kleen
2001-01-10 19:48 ` Alan Cox
2001-01-10 19:48 ` Andi Kleen
2001-01-11 9:51 ` Trond Myklebust
2001-01-10 20:11 ` Linus Torvalds
2001-01-11 12:56 ` Stephen C. Tweedie
2001-01-11 13:10 ` Andi Kleen
2001-01-11 13:12 ` Trond Myklebust
2001-01-11 14:13 ` Stephen C. Tweedie
2001-01-11 19:03 ` Alexander Viro
2001-01-11 19:47 ` Stephen C. Tweedie
2001-01-11 19:57 ` Alexander Viro
2001-01-11 16:50 ` Albert D. Cahalan
2001-01-11 17:35 ` Stephen C. Tweedie
2001-01-11 19:38 ` Albert D. Cahalan
2001-01-11 19:01 ` Alexander Viro
2001-01-09 19:37 ` Linus Torvalds
2001-01-17 8:46 ` Rik van Riel
2001-01-25 22:51 ` Daniel Phillips
2001-01-09 19:53 ` Simon Kirby
2001-01-09 20:08 ` Linus Torvalds
2001-01-09 20:10 ` Zlatko Calusic
2001-01-10 1:45 ` David Woodhouse
2001-01-10 2:26 ` Andrea Arcangeli
2001-01-10 6:57 ` Linus Torvalds
2001-01-10 11:46 ` David Woodhouse
2001-01-10 14:56 ` Andrea Arcangeli
2001-01-10 17:46 ` Eric W. Biederman
2001-01-10 18:33 ` Andrea Arcangeli
2001-01-17 14:26 ` Rik van Riel
2001-01-10 19:03 ` Linus Torvalds
2001-01-10 19:27 ` David S. Miller
2001-01-10 19:36 ` Alan Cox
2001-01-10 23:56 ` David Weinehall
2001-01-11 0:24 ` Alan Cox
2001-01-12 5:56 ` Ralf Baechle
2001-01-12 16:10 ` Eric W. Biederman
2001-01-12 21:11 ` Russell King
2001-01-15 2:56 ` Ralf Baechle
2001-01-15 6:59 ` Eric W. Biederman
2001-01-15 2:53 ` Ralf Baechle
2001-01-17 14:28 ` Rik van Riel
2001-01-18 1:23 ` Linus Torvalds
2001-01-18 11:48 ` Rik van Riel
2001-01-10 17:03 ` Linus Torvalds
2001-01-11 14:36 ` Jim Gettys
2001-01-08 21:30 ` Wayne Whitney
2001-01-07 20:59 Zlatko Calusic
2001-01-07 20:59 ` Zlatko Calusic
2001-01-07 21:37 ` Rik van Riel
2001-01-07 21:37 ` Rik van Riel
2001-01-07 22:33 ` Zlatko Calusic
2001-01-07 22:33 ` Zlatko Calusic
2001-01-09 2:01 ` Zlatko Calusic
2001-01-09 2:01 ` Zlatko Calusic
2001-01-17 4:48 ` Rik van Riel
2001-01-17 4:48 ` Rik van Riel
2001-01-17 18:53 ` Zlatko Calusic
2001-01-17 18:53 ` Zlatko Calusic
2001-01-18 1:32 ` Rik van Riel
2001-01-18 1:32 ` Rik van Riel
2001-04-17 19:37 ` H. Peter Anvin
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=20010108181028.F9321@redhat.com \
--to=sct@redhat.com \
--cc=davem@redhat.com \
--cc=linux-mm@kvack.org \
--cc=marcelo@conectiva.com.br \
--cc=riel@conectiva.com.br \
--cc=torvalds@transmeta.com \
/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.