linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Marcelo Tosatti <marcelo@kvack.org>,
	linux-mm <linux-mm@kvack.org>,
	drepper@redhat.com, Andrew Morton <akpm@linux-foundation.org>,
	mbligh@mbligh.org, balbir@linux.vnet.ibm.com
Subject: Re: [RFC] oom notifications via /dev/oom_notify
Date: Wed, 31 Oct 2007 12:15:57 -0400	[thread overview]
Message-ID: <20071031121557.7b7468c7@bree.surriel.com> (raw)
In-Reply-To: <1193850073.17412.40.camel@dyn9047017100.beaverton.ibm.com>

On Wed, 31 Oct 2007 09:01:13 -0800
Badari Pulavarty <pbadari@us.ibm.com> wrote:

> > Well, if the scheme is implemented "right", then what you
> > describe will never happen because programs will have freed
> > their excess memory already before any swapping happens.
> 
> Hmm.. Most cases, application doesn't care about swapping
> activity of the kernel - unless its something to do with
> one of its own processes/threads. So having notifications
> per-process/app/cgroup is what they are looking for.

That seems awfully short sighted to me.  Additional IO has
the potential to slow any application down, simply by keeping
the disk busy.

Also, if you only send out a notification by the time it is
too late, it will be too late.  You cannot avoid IO if you
do not send out the notification until you've done IO.

If you send out the notification before IO has been done, you
don't know for sure who would have been swapped out.

> But again, how they would react to the notification is 
> an interesting thing. If they really act nice and free
> up stuff they don't need or read more crap and cause
> more swapping :(

The easiest thing an app can do when getting the notification
is to madvise(MADV_DONTNEED) any pages that are on internal
free lists, eg. free(3)d memory, memory on a garbage collector
free list, etc...

Other things that could be done is to reduce the size of a
cache, or to kick off a garbage collector run.

-- 
"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

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-10-31 16:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 19:18 [RFC] oom notifications via /dev/oom_notify Marcelo Tosatti
2007-10-30 20:57 ` Balbir Singh
2007-10-30 22:16   ` Marcelo Tosatti
2007-10-30 21:00 ` Rik van Riel
2007-10-30 21:07 ` Marcelo Tosatti
2007-10-30 21:19   ` Rik van Riel
2007-10-30 22:26     ` Marcelo Tosatti
2007-10-31 17:20   ` Dave Jones
2007-11-01 23:58     ` Marcelo Tosatti
2007-10-30 21:59 ` Badari Pulavarty
2007-10-30 21:12   ` Rik van Riel
2007-10-31  4:17     ` Badari
2007-10-31  4:31       ` Rik van Riel
2007-10-31 17:01         ` Badari Pulavarty
2007-10-31 16:15           ` Rik van Riel [this message]
2007-10-31  5:38       ` Balbir Singh

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=20071031121557.7b7468c7@bree.surriel.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=drepper@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@kvack.org \
    --cc=mbligh@mbligh.org \
    --cc=pbadari@us.ibm.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;
as well as URLs for NNTP newsgroup(s).