From: Linus Torvalds <torvalds@transmeta.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: lkml <linux-kernel@vger.kernel.org>,
Rik van Riel <riel@conectiva.com.br>
Subject: Re: Inclusion of zoned inactive/free shortage patch
Date: Wed, 18 Jul 2001 15:50:03 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.33.0107181534180.1237-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0107181754400.8651-100000@freak.distro.conectiva>
On Wed, 18 Jul 2001, Marcelo Tosatti wrote:
> >
> > Cool.
> >
> > Willing to write a patch and give it some preliminary testing?
>
> Sure. However its not _that_ easy. We do have a global inactive target.
Absolutely. But this is why it's easier to have the more relaxed
constraints - we have to make sure that the global inactive target is
clearly lower than the sum of the relaxed local targets.
That way, whenever there is a global inactive need, we _clearly_ have one
or more zones (usually _all_ of them with any reasonably balanced system:
and note how this whole logic will strive to _add_ balance) that will
trigger the test, and there is no worry that we get into the nasty case
where we suddenly start to try to overly cannibalize one zone horribly.
> There is no perzone inactive shortage, which is needed to calculate
> "zone_inactive_plenty()".
Right. But the gobal inactivity shortage can certainly be a clue to how to
do this.
So when the global shortage is effectively
MAX of
(freepages.high + inactive_target) - nr_free_pages - inactive_clean - inactive_dirty
or
per-zone shortage.
So for this discussion we can ignore the per-zone shortage case (because
_obviously_ the per-zone "inactive_plenty()" cannot be a shortage of
inactive ;), and only concentrate on making sure that the sum of the
per-zone inactive_plenty decisions is noticeably more than the global
shortage (for example, by a factor of two, or something like that). So one
suggestion would be to take the same logic as the global shortage, but
apply it to just the local zone, and then multiply by two (as the slop to
make sure that we don't every under-estimate).
So something like
inactive_plenty(zone)
{
if (!zone->nrpages)
return 0;
shortage = zone->pages_high;
shortage -= zone->inactive_dirty_pages;
shortage -= zone->inactive_clean_pages;
shortage -= zone->free_pages;
/* zone inactive-target is 1/2 of the number of pages */
return shortage < zone->nrpages / 2;
}
(Notice how the "global inactive target" is at most 1/4 of all the
available memory - so now we make the per-zone "inactive target" half of
the zone memory, which means that there's no way we can return "plenty of
inactive" from all zones when we're on global shortage).
Also note how being generous here means that we're not changing the
existing setup all that much - inactive_plenty() will start to refuse
zones only if there really is PLENTY of inactive pages, so we are also
being very conservative here - we're changing existing behaviour only in
cases where we clearly have a balancing problem.
And being conservative during a 2.4.x release is a good thing.
Linus
next prev parent reply other threads:[~2001-07-18 22:51 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-18 0:30 Marcelo Tosatti
2001-07-18 2:05 ` Linus Torvalds
2001-07-18 1:19 ` Marcelo Tosatti
2001-07-18 3:56 ` Linus Torvalds
2001-07-18 2:56 ` Marcelo Tosatti
2001-07-18 4:55 ` Linus Torvalds
2001-07-18 3:46 ` Marcelo Tosatti
2001-07-18 16:30 ` Linus Torvalds
2001-07-18 20:45 ` Marcelo Tosatti
2001-07-18 22:23 ` Linus Torvalds
2001-07-18 20:58 ` Marcelo Tosatti
2001-07-18 22:50 ` Linus Torvalds [this message]
2001-07-18 22:11 ` Marcelo Tosatti
2001-07-18 22:14 ` Marcelo Tosatti
2001-07-19 1:02 ` Linus Torvalds
2001-07-19 7:30 ` Marcelo Tosatti
2001-07-19 17:12 ` Linus Torvalds
2001-07-21 2:55 ` Marcelo Tosatti
2001-07-18 22:57 ` Daniel Phillips
2001-07-18 22:59 ` Linus Torvalds
2001-07-18 23:42 ` Daniel Phillips
2001-07-19 16:33 ` Daniel Phillips
2001-07-18 13:27 ` Rik van Riel
2001-07-18 13:23 ` Rik van Riel
2001-07-18 18:22 ` Mike Galbraith
2001-07-18 18:39 ` Rik van Riel
2001-07-18 19:25 ` Mike Galbraith
2001-07-18 20:02 ` Rik van Riel
2001-07-18 21:25 ` Marcelo Tosatti
2001-07-18 19:50 ` Marcelo Tosatti
2001-07-18 21:37 ` Rik van Riel
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.33.0107181534180.1237-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=riel@conectiva.com.br \
/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
all inboxes | Powered by JetHome®