public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: "linux-os (Dick Johnson)" <linux-os@analogic.com>,
	"Daniel Spång" <daniel.spang@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Out of memory management in embedded systems
Date: Fri, 28 Sep 2007 11:15:46 -0400	[thread overview]
Message-ID: <20070928111546.0c290e57@bree.surriel.com> (raw)
In-Reply-To: <20070928163634.d7fc8909.dada1@cosmosbay.com>

On Fri, 28 Sep 2007 16:36:34 +0200
Eric Dumazet <dada1@cosmosbay.com> wrote:

> On Fri, 28 Sep 2007 10:17:11 -0400
> Rik van Riel <riel@redhat.com> wrote:
> 
> > On Fri, 28 Sep 2007 10:04:23 -0400
> > "linux-os \(Dick Johnson\)" <linux-os@analogic.com> wrote:
> > > On Fri, 28 Sep 2007, [iso-8859-1] Daniel Spång wrote:
> > > 
> > > > On 9/28/07, linux-os (Dick Johnson) <linux-os@analogic.com> wrote:
> > > >>
> > > >> On Fri, 28 Sep 2007, [iso-8859-1] Daniel Spång wrote:
> > 
> > > >>> Some kind of notification to the application that the available memory
> > > >>> is scarce and let the application free up some memory (e.g., by
> > > >>> flushing caches), could be used to improve the situation 
> > 
> > > Any networked appliance can (will) throw data away if there are
> > > no resources available.
> > 
> > That is exactly what Daniel proposed in his first email.
> > 
> > I think his idea makes sense.
> 
> IBM AIX uses SIGDANGER, that kernel can raise in OOM conditions to warn
> processes that are willing to handle this signal (default action for the
>  SIGDANGER signal is to ignore the signal)

I suspect that SIGDANGER is not the right approach, because glibc
memory arenas cannot be manipulated from inside a signal handler.

Also, "nearly OOM" is not the only such signal we would want to
send to userspace programs. It would also be useful to inform
userspace programs when we are about to start swapping something
out, so userspace can discard cached data instead of having to
wait for disk IO in the future.

A unix signal cannot encapsulate two different messages, while
something like a "/dev/lowmem" device can simply be added into
the program's main poll() loop and give many different messages.

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

  reply	other threads:[~2007-09-28 15:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28 12:55 Out of memory management in embedded systems Daniel Spång
2007-09-28 13:09 ` linux-os (Dick Johnson)
2007-09-28 13:30   ` Daniel Spång
2007-09-28 14:04     ` linux-os (Dick Johnson)
2007-09-28 14:14       ` Daniel Spång
2007-09-28 15:16         ` linux-os (Dick Johnson)
2007-09-28 20:58           ` Daniel Spång
2007-09-29 19:48             ` Abhishek Sagar
2007-09-28 14:17       ` Rik van Riel
2007-09-28 14:36         ` Eric Dumazet
2007-09-28 15:15           ` Rik van Riel [this message]
2007-09-28 23:00             ` Nicholas Miell
2007-09-29  1:59 ` Daniel Phillips
     [not found] <98nC1-6aM-9@gated-at.bofh.it>
     [not found] ` <98nVg-6QQ-21@gated-at.bofh.it>
     [not found]   ` <98oeB-7gA-9@gated-at.bofh.it>
     [not found]     ` <98oHC-8ai-5@gated-at.bofh.it>
     [not found]       ` <98oRk-8mt-21@gated-at.bofh.it>
     [not found]         ` <98pNu-1pp-17@gated-at.bofh.it>
2007-09-29  9:15           ` Bodo Eggert
     [not found]           ` <98v6u-1h1-9@gated-at.bofh.it>
     [not found]             ` <98Qu9-170-1@gated-at.bofh.it>
2007-10-01  7:58               ` Markku Savela
2007-10-01  8:13                 ` Bernd Eckenfels
2007-10-01 16:27                   ` david
2007-10-01 20:25                     ` Robin Getz

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=20070928111546.0c290e57@bree.surriel.com \
    --to=riel@redhat.com \
    --cc=dada1@cosmosbay.com \
    --cc=daniel.spang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@analogic.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