linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Michael O'Reilly" <michael@metal.iinet.net.au>
To: "Stephen C. Tweedie" <sct@dcs.ed.ac.uk>
Cc: Rogier Wolff <R.E.Wolff@BitWizard.nl>,
	torvalds@transmeta.com, blah@kvack.org, H.H.vanRiel@fys.ruu.nl,
	nahshon@actcom.co.il, alan@lxorguk.ukuu.org.uk, paubert@iram.es,
	linux-kernel@vger.rutgers.edu, mingo@chiara.csoma.elte.hu,
	linux-mm@kvack.org
Subject: Re: Fairness in love and swapping
Date: 27 Feb 1998 10:56:01 +0800	[thread overview]
Message-ID: <x7hg5l92ny.fsf@metal.iinet.net.au> (raw)
In-Reply-To: "Stephen C. Tweedie"'s message of Thu, 26 Feb 1998 22:33:28 GMT

"Stephen C. Tweedie" <sct@dcs.ed.ac.uk> writes:
> > What we really need is that some mechanism that actually determines
> > in the first and last case that the system is thrashing like hell,
> > and that "swapping" (as opposed to paging) is becoming a required
> > strategy. 
> 
> True.  Any takers for this?  :)
> 

That should be fairly easy. A stab. If the MIN(page in rate, page out
rate) over the last 30 seconds(?) is greater than X, and there are
more than 2(?) processes involved, then start swapping (instead of
paging).

Taking a relatively long baseline means that you need a lot of paging
to trigger. Taking the min of in/out means that it isn't just a
growing process, but something with a working set that's larger than
available ram. Taking the dispertion means that you ignore just one
process running out of ram.

Comments?

The tricky bit there is working out how many processes are
involved. Maybe something as simple as a circular log N elements long
that records the last PID associated with the last page out/in.

This is cheap for the page case, and then you can regularly poll the
rates to check.





int pid_log[N];
int pid_log_next;

page_out/page_in()
	.....
	
	pid_log[pid_log_next] = pid;
	pid_log_next = (pid_log_next+1)&(N-1);

	++page_rate_in;
	....


check_page_rates()
	
	age page rates;
	dispertion = number of different PID's in log;

	if MIN(page_rate_in, page_rate_out) > blah &&
		dispertion > 3) {
		swapping = 1;
	} else {
		swapping = 0;
	}
	...

  parent reply	other threads:[~1998-02-27  2:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-25 20:32 Stephen C. Tweedie
1998-02-25 21:02 ` Linus Torvalds
1998-02-25 21:44   ` Rik van Riel
1998-02-25 21:39 ` Dr. Werner Fink
1998-02-25 22:27   ` Rik van Riel
1998-02-26 11:03     ` Dr. Werner Fink
1998-02-26 11:34       ` Rik van Riel
1998-02-26 18:57         ` Dr. Werner Fink
1998-02-26 19:32           ` Rik van Riel
1998-02-26 22:44         ` Stephen C. Tweedie
1998-02-26 23:34           ` Rik van Riel
1998-02-27 19:41             ` Stephen C. Tweedie
1998-03-02 16:19               ` Rik van Riel
1998-03-02 22:35                 ` Stephen C. Tweedie
1998-03-02 23:14                   ` Rik van Riel
1998-03-03 22:59                     ` Stephen C. Tweedie
1998-02-26  8:05 ` Rogier Wolff
1998-02-26 13:00   ` Dr. Werner Fink
1998-02-26 22:36     ` Stephen C. Tweedie
1998-02-26 23:20       ` Dr. Werner Fink
1998-02-26 14:30   ` Rik van Riel
1998-02-26 22:41     ` Stephen C. Tweedie
1998-02-26 23:21       ` Rik van Riel
1998-02-26 22:33   ` Stephen C. Tweedie
1998-02-26 22:49     ` Rik van Riel
1998-02-27  2:56     ` Michael O'Reilly [this message]
     [not found] <199802270729.IAA00680@cave.BitWizard.nl>
1998-02-27 11:26 ` 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=x7hg5l92ny.fsf@metal.iinet.net.au \
    --to=michael@metal.iinet.net.au \
    --cc=H.H.vanRiel@fys.ruu.nl \
    --cc=R.E.Wolff@BitWizard.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=blah@kvack.org \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=mingo@chiara.csoma.elte.hu \
    --cc=nahshon@actcom.co.il \
    --cc=paubert@iram.es \
    --cc=sct@dcs.ed.ac.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox