linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: James A. Sutherland <jas88@cam.ac.uk>
To: Jonathan Morton <chromi@cyberspace.org>
Cc: "Joseph A. Knapka" <jknapka@earthlink.net>, linux-mm@kvack.org
Subject: Re: suspend processes at load (was Re: a simple OOM ...)
Date: Sun, 22 Apr 2001 18:06:43 +0100	[thread overview]
Message-ID: <re36et84buhdc4mm252om30upobd8285th@4ax.com> (raw)
In-Reply-To: <l03130311b708b57e1923@[192.168.239.105]>

On Sun, 22 Apr 2001 17:53:05 +0100, you wrote:

>>>That might possibly work for some loads, mostly where there are some
>>>processes which are already swapped-in (and have sensible working sets)
>>>alongside the "thrashing" processes.  That would at least give the
>>>well-behaved processes some chance to keep their "active" bits up to date.
>>
>>The trouble is, thrashing isn't really a process level issue: yes,
>>there are a group of processes causing it, but you don't have
>>"thrashing processes" and "non-thrashing processes". Like a car with
>>one wheel stuck in a pool of mud without a diff-lock: yes, you have
>>one or two point(s) where all your engine power is going, and the
>>other wheels are just spinning, but as a result the whole car is going
>>nowhere! In both cases, the answer is to "starve" the spinning
>>wheel(s) of power, allowing the others to pull you out...
>
>Actually, that's not quite how a diff-lock works - it distributes tractive
>effort equally across all four wheels, rather than simply locking a single
>wheel.  You don't get out of a mud puddle by (effectively) braking one
>wheel.

If it's stuck in mud, spinning freely, a diff-lock WILL actually mean
(almost) no power goes to that wheel: it just rotates at the same
speed as the others, with no power being exerted.

>>>However, it doesn't help at all for the cases where some paging-in has to
>>>be done for a well-behaved but only-just-accessed process.
>>
>>Yes it does: we've suspended the runaway process (Netscape, Acrobat
>>Reader, whatever), leaving enough RAM free for login to be paged in.
>
>No, it doesn't.  If we stick with the current page-replacement policy, then
>regardless of what we do with the size of the timeslice, there is always
>going to be the following situation:

This is not just a case of increasing the timeslice: the suspension
strategy avoids the penultimate stage of this list happening:

>- Large process(es) are thrashing.
>- Login needs paging in (is suspended while it waits).
>- Each large process gets it's page and is resumed, but immediately page
>faults again, gets suspended
>- Memory reserved for Login gets paged out before Login can do any useful work

Except suspended processes do not get scheduled for a couple of
seconds, meaning login CAN do useful work.

>- Repeat ad infinitum.

Doesn't repeat, since login has succeeded.

>IOW, even with the current timeslice (which, BTW, depends on 'nice' value -
>setting the memory hogs to nice 19 and XMMS to nice -20 doesn't help), the
>timeslice limit is often never reached for a given process when the system
>is thrashing.  Increasing the timeslice will not help, except for process
>which are already completely resident in memory.  Increasing the suspension
>time *might* help, provided pages newly swapped in get locked in for that
>time period.  Oh, wait a minute...  isn't that exactly what my working-set
>suggestion does?

Not really. Your WS suggestion doesn't evict some processes entirely,
which is necessary under some workloads.

>>>Example of a
>>>critically important process under this category: LOGIN.  :)  IMHO, the
>>>only way to sensibly cater for this case (and a few others) is to update
>>>the page-replacement algorithm.
>>
>>Updating the page replacement algorithm will help, but our core
>>problem remains: we don't have enough pages for the currently active
>>processes! Either we starve SOME processes, or we starve all of
>>them...
>
>Or we distribute the "tractive effort" (physical RAM) equally (or fairly)
>among them, just like the diff-lock you so helpfully mentioned.  :)  A 4x4
>vehicle doesn't perform optimally when the diff-lock is applied, but it's
>certainly an improvement in the case where one wheel would otherwise spin
>uselessly.

Distributing "fairly" is sub-optimal: sequential suspension and
resumption of each memory hog will yield far better performance. To
the extent some workloads fail with your approach but succeed with
mine: if a process needs more than the current working-set in RAM to
make progress, your suggestion leaves each process spinning, taking up
resources.

>Right now, the page-replacement policy simply finds a page it "can" swap
>out, and pays only cursory attention to whether it's actually in use.  I
>firmly believe it's well worth spending a little more effort there to
>reduce the amount of swapping required for a given VM load, especially if
>it means that Linux gets more stable under such loads.  Piddling around
>with the scheduler won't do that, although it might help with pathological
>loads *iff* we get a better pager.

On the contrary: tweaking page-replacement will probably help in most
cases, but won't solve any pathological case.


James.
--
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/

  reply	other threads:[~2001-04-22 17:06 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-19 14:03 Jonathan Morton
2001-04-19 18:25 ` Dave McCracken
2001-04-19 18:32   ` James A. Sutherland
2001-04-19 20:23     ` Jonathan Morton
2001-04-20 12:14     ` Szabolcs Szakacsits
2001-04-20 12:02       ` Jonathan Morton
2001-04-20 14:48       ` Dave McCracken
2001-04-21  5:49       ` James A. Sutherland
2001-04-21 19:16         ` Joseph A. Knapka
2001-04-21 19:41           ` Jonathan Morton
2001-04-22 10:08             ` James A. Sutherland
2001-04-22 16:53               ` Jonathan Morton
2001-04-22 17:06                 ` James A. Sutherland [this message]
2001-04-22 18:18                   ` Jonathan Morton
2001-04-22 18:57                     ` Rik van Riel
2001-04-22 19:41                       ` James A. Sutherland
2001-04-22 20:33                         ` Jean Francois Martinez
2001-04-22 20:21                       ` Jonathan Morton
2001-04-22 20:36                         ` Jonathan Morton
2001-04-22 19:01                     ` James A. Sutherland
2001-04-22 19:11                       ` Rik van Riel
2001-04-22 20:36                         ` James A. Sutherland
2001-04-22 19:30                       ` Jonathan Morton
2001-04-22 20:35                         ` James A. Sutherland
2001-04-22 20:41                           ` Rik van Riel
2001-04-22 20:58                             ` James A. Sutherland
2001-04-22 21:26                               ` Rik van Riel
2001-04-22 22:26                                 ` Jonathan Morton
2001-04-23  5:55                                   ` James A. Sutherland
2001-04-23  5:59                                     ` Rik van Riel
2001-04-21 20:29           ` Rik van Riel
2001-04-22 10:08           ` James A. Sutherland
  -- strict thread matches above, loose matches on Subject: below --
2001-04-13 16:20 [PATCH] a simple OOM killer to save me from Netscape Rik van Riel
2001-04-16 12:17 ` suspend processes at load (was Re: a simple OOM ...) Szabolcs Szakacsits
2001-04-17 19:48   ` Rik van Riel
2001-04-18 21:32     ` Szabolcs Szakacsits
2001-04-18 20:38       ` James A. Sutherland
2001-04-18 23:25         ` Szabolcs Szakacsits
2001-04-18 22:29           ` Rik van Riel
2001-04-19 10:14             ` Stephen C. Tweedie
2001-04-19 13:23             ` Szabolcs Szakacsits
2001-04-19  2:11           ` Rik van Riel
2001-04-19  7:08             ` James A. Sutherland
2001-04-19 13:37               ` Szabolcs Szakacsits
2001-04-19 12:26                 ` Christoph Rohland
2001-04-19 12:30                 ` James A. Sutherland
2001-04-19  9:15           ` James A. Sutherland
2001-04-19 18:34       ` Dave McCracken
2001-04-19 18:47         ` James A. Sutherland
2001-04-19 18:53           ` Dave McCracken
2001-04-19 19:10             ` James A. Sutherland
2001-04-20 14:58               ` Rik van Riel
2001-04-21  6:10                 ` James A. Sutherland
2001-04-19 19:13             ` Rik van Riel
2001-04-19 19:47               ` Gerrit Huizenga
2001-04-20 12:44                 ` Szabolcs Szakacsits
2001-04-19 20:06               ` James A. Sutherland
2001-04-20 12:29               ` Szabolcs Szakacsits
2001-04-20 11:50                 ` Jonathan Morton
2001-04-20 13:32                   ` Szabolcs Szakacsits
2001-04-20 14:30                     ` Rik van Riel
2001-04-22 10:21                 ` James A. Sutherland
2001-04-20 12:25           ` Szabolcs Szakacsits
2001-04-21  6:08             ` James A. Sutherland
2001-04-20 12:18         ` Szabolcs Szakacsits
2001-04-22 10:19           ` James A. Sutherland

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=re36et84buhdc4mm252om30upobd8285th@4ax.com \
    --to=jas88@cam.ac.uk \
    --cc=chromi@cyberspace.org \
    --cc=jknapka@earthlink.net \
    --cc=linux-mm@kvack.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