linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Spång" <daniel.spang@gmail.com>
To: Rik van Riel <riel@redhat.com>
Cc: Marcelo Tosatti <marcelo@kvack.org>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mem notifications v2
Date: Fri, 23 Nov 2007 01:27:38 +0100	[thread overview]
Message-ID: <cfd9edbf0711221627n55c9220dhe3d6bd44449c47b4@mail.gmail.com> (raw)
In-Reply-To: <20071122154736.02325eca@bree.surriel.com>

On 11/22/07, Rik van Riel <riel@redhat.com> wrote:
> On Thu, 22 Nov 2007 12:23:55 +0100
> "Daniel Spang" <daniel.spang@gmail.com> wrote:
>
> > When the page cache is filled, the notification is a bit early as the
> > following example shows on a small system with 64 MB ram and no swap.
> > On the first run the application can use 58 MB of anonymous pages
> > before notification is sent. Then after the page cache is filled the
> > test application is runned again and is only able to use 49 MB before
> > being notified.
>
> Excellent.  Throwing away useless memory when three is still
> useful memory available sounds like a good idea.
>
> > I see it as a feature to be able to throw out inactive binaries and
> > mmaped files before getting notified about low memory.
>
> I think that once you get low on memory, you want a bit of
> both.  Inactive binaries and mmaped files are potentially
> useful; in-process free()d memory and caches are just as
> potentially (dubiously) useful.
>
> Freeing a bit of both will probably provide a good compromise
> between CPU and memory efficiency.

I get your point, but strictly speaking, it is never freeing inactive
binaries nor mapped files until all in-process cache are freed. But
your argument is still valid, although a tad weaker, if you replace
``inactive binaries and mmaped files'' with ``page cache''.

> > I suggest we add both this notification and my priority threshold
> > based approach, then the users can chose which one to use.
>
> That sounds like a horribly bad idea, because we run the
> danger of ending up with two sets of applications, both of
> which expect another notification type.
>
> One type of application can cause the other to receive
> unfair amounts of memory pressure.

Sorry, I was a bit vague. I meant using two separate devices and that
the programmer could chose which one to use, based on the importance
of the in-process cache and hopefully decide if it is more valuable
than inactive binaries mmaped files and, to some extent, page cache.

--
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-11-23  0:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21 19:53 Marcelo Tosatti
2007-11-22  3:07 ` kosaki
2007-11-22 17:37   ` Marcelo Tosatti
2007-11-26 11:18     ` kosaki
2007-11-22 11:23 ` Daniel Spång
2007-11-22 20:47   ` Rik van Riel
2007-11-23  0:27     ` Daniel Spång [this message]
2007-11-23  0:36       ` Rik van Riel
2007-11-23 12:42         ` Daniel Spång

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=cfd9edbf0711221627n55c9220dhe3d6bd44449c47b4@mail.gmail.com \
    --to=daniel.spang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@kvack.org \
    --cc=riel@redhat.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