From: Linus Torvalds <torvalds@transmeta.com>
To: Rik van Riel <H.H.vanRiel@phys.uu.nl>
Cc: Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH] swapin readahead v3 + kswapd fixes
Date: Wed, 16 Dec 1998 17:24:05 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.3.95.981216171905.2111A-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.3.96.981201075322.509A-100000@mirkwood.dummy.home>
On Tue, 1 Dec 1998, Rik van Riel wrote:
>
> --- ./mm/vmscan.c.orig Thu Nov 26 11:26:50 1998
> +++ ./mm/vmscan.c Tue Dec 1 07:12:28 1998
> @@ -431,6 +431,8 @@
> kmem_cache_reap(gfp_mask);
>
> if (buffer_over_borrow() || pgcache_over_borrow())
> + state = 0;
> + if (atomic_read(&nr_async_pages) > pager_daemon.swap_cluster / 2)
> shrink_mmap(i, gfp_mask);
>
> switch (state) {
I really hate the above tests that make no sense at all from a conceptual
view, and are fairly obviously just something to correct for a more basic
problem.
So I've removed them, and re-written the logic for the "state" in the VM
scanning. I made "state" be private to the invocation, and always start at
zero - and could thus remove it altogether.
That means that the first thing freeing memory always tries to do is the
shrink_mmap() thing, and thus the problem becomes one of just making sure
that shrink_mmap() doesn't try _too_ aggressively to throw out stuff that
is still needed. So I changed shrink_mmap() too a bit, and simplified that
too (so that it looks at at most 1/32th of all memory on the first try,
and if it can't find anything to free there it lets the other memory
de-allocators have a go at it).
It's a lot simpler, has no arbitrary heuristics like the above two tests,
and worked for me both with a small memory setup and my normal half gig
setup. Would you guys please test and comment? It's in the pre-2.1.132-1
patch.
Linus "arbitrary rules are bad rules" Torvalds
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next prev parent reply other threads:[~1998-12-17 1:24 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-01 6:55 Rik van Riel
1998-12-01 8:15 ` Andrea Arcangeli
1998-12-01 15:28 ` Rik van Riel
1998-12-17 1:24 ` Linus Torvalds [this message]
1998-12-19 17:09 ` New patch (was Re: [PATCH] swapin readahead v3 + kswapd fixes) Stephen C. Tweedie
1998-12-19 18:41 ` Linus Torvalds
1998-12-19 19:41 ` Linus Torvalds
1998-12-19 22:01 ` Stephen C. Tweedie
1998-12-20 3:05 ` Linus Torvalds
1998-12-20 14:18 ` Linus Torvalds
1998-12-21 13:03 ` Andrea Arcangeli
1998-12-21 13:39 ` Stephen C. Tweedie
1998-12-21 14:08 ` Andrea Arcangeli
1998-12-21 16:42 ` Stephen C. Tweedie
1998-12-21 9:53 ` Andrea Arcangeli
1998-12-21 16:37 ` Stephen C. Tweedie
1998-12-21 17:58 ` Linus Torvalds
1998-12-21 18:59 ` Stephen C. Tweedie
1998-12-21 19:38 ` Linus Torvalds
1998-12-22 7:56 ` Eric W. Biederman
1998-12-22 10:49 ` Andrea Arcangeli
1998-12-22 15:32 ` Eric W. Biederman
1998-12-22 15:40 ` Andrea Arcangeli
1998-12-22 16:26 ` Linus Torvalds
1998-12-22 19:55 ` Eric W. Biederman
1998-12-22 20:25 ` Rik van Riel
1998-12-22 21:56 ` Linus Torvalds
1998-12-22 20:10 ` Rik van Riel
1998-12-22 22:35 ` Andrea Arcangeli
1998-12-23 8:45 ` Rik van Riel
1998-12-22 20:03 ` Rik van Riel
1998-12-22 17:23 ` [patch] swap_out now really free (the right) pages [Re: New patch (was Re: [PATCH] swapin readahead v3 + kswapd fixes)] Andrea Arcangeli
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.3.95.981216171905.2111A-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=H.H.vanRiel@phys.uu.nl \
--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