From: Linus Torvalds <torvalds@transmeta.com>
To: Rajagopal Ananthanarayanan <ananth@sgi.com>
Cc: riel@nl.linux.org, Benjamin Redelings I <bredelin@ucla.edu>,
linux-mm@kvack.org
Subject: Re: [DATAPOINT] pre7-6 will not swap
Date: Sat, 6 May 2000 19:23:36 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.10.10005061905180.29159-100000@cesium.transmeta.com> (raw)
In-Reply-To: <39149B81.B92C8741@sgi.com>
On Sat, 6 May 2000, Rajagopal Ananthanarayanan wrote:
>
> I have a hunch. Follow this argument closely. In shrink_mmap we have:
>
> ------------
> if (p_zone->free_pages > p_zone->pages_high)
> goto dispose_continue;
> ------
>
> This page doesn't count against a valid try in shrink_mmap().
[ second-scan logic ]
Ugh.
This may be right, but it also gets my hackles up for being "too
contrieved". It shouldn't be this complex.
Either "shrink_mmap()" should care about the zone or it shouldn't. If it
should, then it should just check the particular zone that it was passed
in (ie basically per-zone LRU again). If it shouldn't, then it probably
should just take the LRU as-is.
Also, one thing that keeps me wondering is whether the current
"try_to_free_pages()" is right at all.
Remember: the fundamental operation isn't really "try_to_free_pages()"
Nobody really ever calls that directly. The fundamental operation we
want to have is really just "balance_zones()", and it may be that the
by isolating the "zone" we're aiming for early in balance_zones() we've
done a mistake.
My personal inclination is along the lines of
- we never really care about any particular zone. We should make sure
that all zones get balanced, and that is what running kswapd will
eventually cause.
- things like "shrink_mmap" and "vmscan" should both free any page from
any zone that is (a) a good candidateand (b) the zone is not yet
well-balanced.
- looking at "shrink_mmap()", my reaction would not be to add more
complexity to it, but to remove the _one_ special case that looks at
one specific zone:
/* wrong zone? not looped too often? roll again... */
if (page->zone != zone && count)
goto again;
I would suggest just removing that test altogether. The page wasn't
from a "wrong zone". It was just a different zone that also needed
balancing.
That single test stands out as being zone-specific instead of geared
towards the bigger goal of "let's balance the zones". It would also cause
"shrink_mmap()" to =return= failure, even if shrink_mmap() actually ended
up doing real work. Which just seems wrong.
So instead of making that test more complicated and adding a "phase"
counter, why not just remove it? Then "shrink_mmap()"will start failing
onlywhen it _truly_ fails - ie when it no longer can find any pages really
worth freeing.
Linus "gut instinct" Torvalds
--
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:[~2000-05-07 2:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8evk0f$7jote$1@fido.engr.sgi.com>
2000-05-06 17:12 ` Rajagopal Ananthanarayanan
2000-05-06 4:25 ` Benjamin Redelings I
2000-05-06 19:35 ` Linus Torvalds
2000-05-06 5:35 ` Benjamin Redelings I
2000-05-06 21:46 ` Rik van Riel
2000-05-06 22:24 ` Rajagopal Ananthanarayanan
2000-05-06 14:03 ` Benjamin Redelings I
2000-05-07 0:22 ` Rik van Riel
2000-05-07 2:23 ` Linus Torvalds [this message]
2000-05-07 17:40 ` Rik van Riel
2000-05-07 17:53 ` Linus Torvalds
2000-05-07 19:13 ` Rajagopal Ananthanarayanan
2000-05-07 19:30 ` Linus Torvalds
2000-05-08 20:40 ` gprof data for pre7-6 Rajagopal Ananthanarayanan
2000-05-09 1:52 ` [DATAPOINT] pre7-6 will not swap Quintela Carreira Juan J.
2000-05-09 2:28 ` Rajagopal Ananthanarayanan
2000-05-09 2:33 ` Linus Torvalds
2000-05-09 3:31 ` Rajagopal Ananthanarayanan
2000-05-09 15:56 ` [DATAPOINT] pre7-8 swaps with FREE mem? Benjamin Redelings I
2000-05-06 20:12 ` PG_referenced and lru_cache (cpu%) Roger Larsson
2000-05-06 18:31 ` Rik van Riel
2000-05-06 22:16 ` Roger Larsson
2000-05-05 8:07 [DATAPOINT] pre7-6 will not swap Benjamin Redelings I
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.10.10005061905180.29159-100000@cesium.transmeta.com \
--to=torvalds@transmeta.com \
--cc=ananth@sgi.com \
--cc=bredelin@ucla.edu \
--cc=linux-mm@kvack.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