From: Linus Torvalds <torvalds@transmeta.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Rik van Riel <H.H.vanRiel@phys.uu.nl>,
Linux MM <linux-mm@kvack.org>,
Andrea Arcangeli <andrea@e-mind.com>,
Alan Cox <number6@the-village.bc.nu>
Subject: Re: New patch (was Re: [PATCH] swapin readahead v3 + kswapd fixes)
Date: Sat, 19 Dec 1998 11:41:56 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.3.95.981219112608.348B-100000@penguin.transmeta.com> (raw)
In-Reply-To: <199812191709.RAA01245@dax.scot.redhat.com>
Btw, Steven, there's another approach that might actually be the best one,
and that also makes a ton of sense to me. I'm not married to any specific
approach, but basically what I want is that whatever we do it should be
sensible, in a way that we can say "this is the basic approach", and then
when you read the code you see that yes, that's what it does. In other
words, something "pretty".
If you're testing different approaches, how about this one (_reasoning_
first, not just some magic heuristic):
- kswapd and normal processes are decidedly different animals - that's
fairly obvious. A normal process wants low latency in order to go on
with what it's doing, while kswapd is meant to be this background
deamon to make sure we can get memory with low latency.
- as a result, it doesn't necessarily make sense to have the same
"do_try_to_free_page()" for them both. For example, for a normal
process, it makes sense to do a shrink_mmap() more aggressively to just
try to get rid of some page without actually having to do any IO. In
contrast, kswapd quite naturally wants to be more aggressive about
paging things out so that when a regular process does need memory, it
will get it easily without having to wait for it.
So with the above premise of _not_ trying to make one function work for
both cases, how about:
- regular processes use something that looks very much like the
"do_try_to_free_page()" in pre-2. No state crap, and it uses
shrink_mmap() first (and then it can be reasonably aggressive, so
forget about increasing "i" to make it timid)
- kswapd uses something totally different, which essentially looks more
like the previous loop that used a state to "stay" in a good mode for a
while. We want kswapd to "stay" in the swap-out mode in order to get
nice cpntiguous bursty page-outs that we can do efficiently.
Does the above make sense to you? It would quite naturally explain your
"magic heuristic" in your previous patch with "current != kswapd", but
would be more explainable and cleaner - be quite up front about the fact
that kswapd tries to generate nice page-out patterns, while normal
processes (when they have to call try_to_free_page() at all, which is
hopefully not too often) just want to get memory quickly.
Linus
--
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-19 19:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-01 6:55 [PATCH] swapin readahead v3 + kswapd fixes 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
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 [this message]
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.981219112608.348B-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=H.H.vanRiel@phys.uu.nl \
--cc=andrea@e-mind.com \
--cc=linux-mm@kvack.org \
--cc=number6@the-village.bc.nu \
--cc=sct@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox