All of lore.kernel.org
 help / color / mirror / Atom feed
From: Werner Almesberger <wa@almesberger.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrea Arcangeli <andrea@novell.com>,
	Jesse Barnes <jbarnes@sgi.com>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	Andrew Morton <akpm@osdl.org>,
	Nick Piggin <piggin@cyberone.com.au>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, Chris Ross <chris@tebibyte.org>
Subject: Re: [PATCH] Remove OOM killer from try_to_free_pages / all_unreclaimable braindamage
Date: Wed, 17 Nov 2004 19:54:17 -0300	[thread overview]
Message-ID: <20041117195417.A3289@almesberger.net> (raw)
In-Reply-To: <1099706150.2810.147.camel@thomas>; from tglx@linutronix.de on Sat, Nov 06, 2004 at 02:55:50AM +0100

Entering an old discussion ...

Thomas Gleixner wrote:
> context in which oom-killer is called. My concern is that the decision
> critrion which process should be killed is not sufficient. In my case it
> kills sshd instead of a process which forks a bunch of child processes.

It recently occurred to me that we could have relatively light-weight
voluntary victimization for known trouble-makers. E.g. in a desktop
environment, the cause for trouble seems to be almost always the Web
browser, or something closely related to it.

A process could declare itself as usual suspect. This would then be
recorded as a per-task flag, to be inherited by children. Now, one
could write a launcher like this:

int main(int argc,char **argv)
{
    if (argc < 2) {
	fprintf(stderr,"usage: %s command [arguments...]\n",*argv);
	return 1;
    }
    sys_suspect_me();
    execvp(argv[1],argv+1);
    perror(argv[1]);
    return 1;
}

And then something like

# mv /usr/bin/browser /usr/bin/browser.bin
# echo '#!/bin/sh' >/usr/bin/browser
# echo 'suspect_me /usr/bin/browser.bin "$@"' >>/usr/bin/browser
# chmod 555 /usr/bin/browser

or use an alias if you like your packet manager.

Not sure if this would actually be useful in real life, but it looks
at least like a relatively simple and flexible solution to a part of
the selection problem.

One could even consider getting rid of the suspects a while before
hitting OOM, so that the system doesn't have to slow down before the
inevitable killing.

Not that'm getting many OOMs these days - my VNC setup is quite good
at dying well before anything serious turns up :-(

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/

WARNING: multiple messages have this Message-ID (diff)
From: Werner Almesberger <wa@almesberger.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrea Arcangeli <andrea@novell.com>,
	Jesse Barnes <jbarnes@sgi.com>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	Andrew Morton <akpm@osdl.org>,
	Nick Piggin <piggin@cyberone.com.au>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, Chris Ross <chris@tebibyte.org>
Subject: Re: [PATCH] Remove OOM killer from try_to_free_pages / all_unreclaimable braindamage
Date: Wed, 17 Nov 2004 19:54:17 -0300	[thread overview]
Message-ID: <20041117195417.A3289@almesberger.net> (raw)
In-Reply-To: <1099706150.2810.147.camel@thomas>; from tglx@linutronix.de on Sat, Nov 06, 2004 at 02:55:50AM +0100

Entering an old discussion ...

Thomas Gleixner wrote:
> context in which oom-killer is called. My concern is that the decision
> critrion which process should be killed is not sufficient. In my case it
> kills sshd instead of a process which forks a bunch of child processes.

It recently occurred to me that we could have relatively light-weight
voluntary victimization for known trouble-makers. E.g. in a desktop
environment, the cause for trouble seems to be almost always the Web
browser, or something closely related to it.

A process could declare itself as usual suspect. This would then be
recorded as a per-task flag, to be inherited by children. Now, one
could write a launcher like this:

int main(int argc,char **argv)
{
    if (argc < 2) {
	fprintf(stderr,"usage: %s command [arguments...]\n",*argv);
	return 1;
    }
    sys_suspect_me();
    execvp(argv[1],argv+1);
    perror(argv[1]);
    return 1;
}

And then something like

# mv /usr/bin/browser /usr/bin/browser.bin
# echo '#!/bin/sh' >/usr/bin/browser
# echo 'suspect_me /usr/bin/browser.bin "$@"' >>/usr/bin/browser
# chmod 555 /usr/bin/browser

or use an alias if you like your packet manager.

Not sure if this would actually be useful in real life, but it looks
at least like a relatively simple and flexible solution to a part of
the selection problem.

One could even consider getting rid of the suspects a while before
hitting OOM, so that the system doesn't have to slow down before the
inevitable killing.

Not that'm getting many OOMs these days - my VNC setup is quite good
at dying well before anything serious turns up :-(

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
--
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-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  parent reply	other threads:[~2004-11-17 22:59 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-05 20:01 [PATCH] Remove OOM killer from try_to_free_pages / all_unreclaimable braindamage Marcelo Tosatti
2004-11-05 20:01 ` Marcelo Tosatti
2004-11-05 23:32 ` Jesse Barnes
2004-11-05 23:47   ` Thomas Gleixner
2004-11-05 23:47     ` Thomas Gleixner
2004-11-06  1:20   ` Andrea Arcangeli
2004-11-06  1:20     ` Andrea Arcangeli
2004-11-06  1:26     ` Nick Piggin
2004-11-06  1:26       ` Nick Piggin
2004-11-06  1:36       ` Jesse Barnes
2004-11-06  1:36         ` Jesse Barnes
2004-11-06  1:50       ` Andrea Arcangeli
2004-11-06  1:50         ` Andrea Arcangeli
2004-11-06  9:47         ` Hugh Dickins
2004-11-06  9:47           ` Hugh Dickins
2004-11-06 10:53           ` Nick Piggin
2004-11-06 10:53             ` Nick Piggin
2004-11-06 15:29             ` Andrea Arcangeli
2004-11-06 15:29               ` Andrea Arcangeli
2004-11-06 15:29           ` Andrea Arcangeli
2004-11-06 15:29             ` Andrea Arcangeli
2004-11-06 16:21             ` Hugh Dickins
2004-11-06 16:21               ` Hugh Dickins
2004-12-10  6:02               ` William Lee Irwin III
2004-12-10  6:02                 ` William Lee Irwin III
2004-11-06 11:37         ` Nikita Danilov
2004-11-06 11:37           ` Nikita Danilov
2004-11-06 15:32           ` Andrea Arcangeli
2004-11-06 15:32             ` Andrea Arcangeli
2004-11-06 16:54             ` Nikita Danilov
2004-11-06 16:54               ` Nikita Danilov
2004-11-06 17:44               ` Andrea Arcangeli
2004-11-06 17:44                 ` Andrea Arcangeli
2004-11-06 19:24                 ` Nikita Danilov
2004-11-06 19:24                   ` Nikita Danilov
2004-11-07  1:16                   ` Andrea Arcangeli
2004-11-07  1:16                     ` Andrea Arcangeli
2004-11-06 10:11       ` Marcelo Tosatti
2004-11-06 10:11         ` Marcelo Tosatti
2004-11-06  1:55     ` Thomas Gleixner
2004-11-06  1:55       ` Thomas Gleixner
2004-11-06 10:28       ` Marcelo Tosatti
2004-11-06 10:28         ` Marcelo Tosatti
2004-11-17 22:54       ` Werner Almesberger [this message]
2004-11-17 22:54         ` Werner Almesberger
2004-11-17 23:27         ` Chris Ross
2004-11-17 23:27           ` Chris Ross
2004-11-18  0:04           ` Werner Almesberger
2004-11-18  0:04             ` Werner Almesberger
2004-11-18  0:28             ` Chris Ross
2004-11-18  0:28               ` Chris Ross
2004-11-18  1:14               ` Werner Almesberger
2004-11-18  1:14                 ` Werner Almesberger
2004-11-18  8:20                 ` Chris Ross
2004-11-18  8:20                   ` Chris Ross
2004-11-18 10:01                   ` Werner Almesberger
2004-11-18 10:01                     ` Werner Almesberger
2004-11-18 14:44                     ` Thomas Gleixner
2004-11-18 14:44                       ` Thomas Gleixner
2004-11-18 15:10                       ` Chris Friesen
2004-11-18 15:10                         ` Chris Friesen
2004-11-06 10:05     ` Marcelo Tosatti
2004-11-06 10:05       ` Marcelo Tosatti
2004-11-06 15:44       ` Andrea Arcangeli
2004-11-06 15:44         ` Andrea Arcangeli
2004-11-06 15:52         ` Arjan van de Ven
2004-11-06 15:52           ` Arjan van de Ven
2004-11-06 17:09         ` Marcelo Tosatti
2004-11-06 17:09           ` Marcelo Tosatti
2004-11-07  0:48           ` Andrea Arcangeli
2004-11-07  0:48             ` Andrea Arcangeli
2004-11-07 11:21             ` Marcelo Tosatti
2004-11-07 11:21               ` Marcelo Tosatti
2004-11-06 12:53 ` [PATCH] Remove OOM killer Andries Brouwer
2004-11-06 12:53   ` Andries Brouwer
2004-11-06 10:41   ` Marcelo Tosatti
2004-11-06 10:41     ` Marcelo Tosatti
2004-11-07  9:26   ` Marko Macek
2004-11-07  9:26     ` Marko Macek
2004-11-07 11:34     ` memory overcommit (was: [PATCH] Remove OOM killer ...) Anton Ertl
2004-11-08 16:27 ` [PATCH] Remove OOM killer from try_to_free_pages / all_unreclaimable braindamage Marcelo Tosatti
2004-11-08 16:27   ` Marcelo Tosatti
2004-11-08 18:55   ` Marcelo Tosatti
2004-11-09  2:22     ` Nick Piggin
2004-11-09  2:35       ` Andrew Morton
2004-11-09  2:46         ` Nick Piggin
2004-11-09  7:18           ` Marcelo Tosatti
2004-11-09  7:15         ` Marcelo Tosatti
2004-11-10  1:11           ` Nick Piggin
     [not found] <fa.ev73q5c.ejcnom@ifi.uio.no>
     [not found] ` <fa.es1mdq5.76ib8j@ifi.uio.no>
2004-11-18 20:48   ` Bodo Eggert
2004-11-18 21:15     ` Werner Almesberger
2004-11-19  1:05       ` Bodo Eggert
2004-11-19  0:15     ` Andreas Dilger

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=20041117195417.A3289@almesberger.net \
    --to=wa@almesberger.net \
    --cc=akpm@osdl.org \
    --cc=andrea@novell.com \
    --cc=chris@tebibyte.org \
    --cc=jbarnes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=piggin@cyberone.com.au \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.