lkml.org 
[lkml]   [1998]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Fairness in love and swapping
From
Date
"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;
}
...



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site