mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Load control  (was: Re: 2.4.9-ac16 good perfomer?)
@ 2001-10-01 14:49 Jesse Pollard
  2001-10-01 15:51 ` Daniel Phillips
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Pollard @ 2001-10-01 14:49 UTC (permalink / raw)
  To: riel, Daniel Phillips; +Cc: Mike Fedyk, linux-kernel, linux-mm

Rik van Riel <riel@conectiva.com.br>:
> On Mon, 1 Oct 2001, Daniel Phillips wrote:
> 
> > Nice.  With this under control, another feature of his memory manager
> > you could look at is the variable deactivation threshold, which makes
> > a whole lot more sense now that the aging is linear.
> 
> Actually, when we get to the point where deactivating enough
> pages is hard, we know the working set is large and we should
> be _more careful_ in chosing what to page out...
>
> When we go one step further, where the working set approaches
> the size of physical memory, we should probably start doing
> load control FreeBSD-style ... pick a process and deactivate
> as many of its pages as possible. By introducing unfairness
> like this we'll be sure that only one or two processes will
> slow down on the next VM load spike, instead of all processes.
> 
> Once we reach permanent heavy overload, we should start doing
> process scheduling, restricting the active processes to a
> subset of all processes in such a way that the active processes
> are able to make progress. After a while, give other processes
> their chance to run.

Just a comment:
This begins to sound like the old VMS handling:
1. When not loaded down, all processes allocate freely.
2. When getting tight, trim all processes down some amount, until enough is
   free (balanced by page fault rate measure - process with the lowest fault
   rate gets trimmed first).
3. Continue triming until required space available or all processes are at
   their working set minimum.
4. if still tight, swap a process completely (determined by length of time
   since last IO wait - larger CPU bound jobs/processes got swaped first),
   reclaim memory. Note, at this point OOM may occur.
5. If swap full, do not start new processes (ENOMEM)
6. When a process exits, reclaim memory - if working set minimum available
   then swapin a process.

I also vaguely remember something about processes spawning new processes -
if memory wasn't immediately available (working set minimum for the new
process) then the process attempting the spawn is put to sleep (or swapped,
or both - this may have only occured if there was room in swap for the
process, if not - ENOMEM on the fork, in case that causes the parent to
exit and free more memory).

The trimming action did not immediately cause a pageout - all that was
needed was to reduce the working set size. The process that needed memory
would then cause the system to scan memory for pages that could be freed.
The first process examined (may have been the process asking for memory)
would have the excess pages paged out. (I believe they were chosen by a
LRU mechanism)

There was also a scheduling fairness rule about swapped processes geting
a schedule increment of 1, in memory processes got incremented 4, IO wait
processes got +6. When they were selected for run: if previous state was IO,
then decrement by 2, if state run, decrement by 2. If a swapped process
schedule value > in memory process, swap the memory resident process out,
swapin  the swaped process. (Oviously this isn't quite right :-)



-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: 2.4.9-ac16 good perfomer?
@ 2001-10-01 11:14 Daniel Phillips
  2001-10-01 13:57 ` Load control (was: Re: 2.4.9-ac16 good perfomer?) Rik van Riel
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Phillips @ 2001-10-01 11:14 UTC (permalink / raw)
  To: Rik van Riel, Mike Fedyk; +Cc: linux-kernel

On September 29, 2001 03:20 am, Rik van Riel wrote:
> > Is it normal to have Inact_target 1/4 of main memory (64MB of 256MB RAM)?
> > In previous versions, this value would fluctuate with the load of the
> > system.
> >
> > Is this expected?
> 
> Yes, this is a 'compensation' for the fact that page aging changed
> from exponential to linear.  The combination of linear page aging
> with a large inactive_target results in a good combination of
> frequency- and recency-based page eviction.
> 
> Doing just linear page aging with a small inactive target resulted
> in worse throughput than exponential page aging for some workloads,
> better for other workloads.  Linear page aging with a large inactive
> target results in good througput and latency under all workloads I've
> found up to now.  As usual, thanks go out to Matt Dillon for finding
> this balancing point.

Nice.  With this under control, another feature of his memory manager you 
could look at is the variable deactivation threshold, which makes a whole lot 
more sense now that the aging is linear.  To implement it efficiently 
PAGE_AGE_DECL just needs to be a variable, since in effect the deactivation 
threshold already is exactly PAGE_AGE_DECL.

How to set this variable is a deep and interesting question.  Matt had his 
ideas on that as you know, and in fact it's a key feature of the BSD 
mm it, but it's far from clear that the BSD arrangement could be used 
directly in Linux.  There are a number of obvious difficulties: no reverse 
map, highmem, more caches to balance, and so on.  However, it's intuitively 
clear that the mm sweet spot can be made bigger by controlling the DECL 
variable, i.e., we can push the thrash point further out for a wider variety 
of loads.

Obligatory disclaimer: there is no burning issue here; this is a 
*developmental* idea.

--
Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-10-01 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-01 14:49 Load control (was: Re: 2.4.9-ac16 good perfomer?) Jesse Pollard
2001-10-01 15:51 ` Daniel Phillips
  -- strict thread matches above, loose matches on Subject: below --
2001-10-01 11:14 2.4.9-ac16 good perfomer? Daniel Phillips
2001-10-01 13:57 ` Load control (was: Re: 2.4.9-ac16 good perfomer?) Rik van Riel
2001-10-01 16:05   ` Daniel Phillips

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®