linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "KOSAKI Motohiro" <kosaki.motohiro@jp.fujitsu.com>
To: "Andreas Dilger" <adilger@sun.com>
Cc: "Jon Masters" <jonathan@jonmasters.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Marcelo Tosatti" <marcelo@kvack.org>,
	"Daniel Spang" <daniel.spang@gmail.com>,
	"Rik van Riel" <riel@redhat.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"Pavel Machek" <pavel@ucw.cz>, "Al Boldi" <a1426z@gawab.com>,
	"Zan Lynx" <zlynx@acm.org>
Subject: Re: [sample] mem_notify v6: usage example
Date: Tue, 12 Feb 2008 03:37:10 +0900	[thread overview]
Message-ID: <2f11576a0802111037j4fe75e80l695f5a401ec93a7a@mail.gmail.com> (raw)
In-Reply-To: <20080211181526.GC3029@webber.adilger.int>

Hi Andreas,

Thank you very good comment.

> Having such notification handled by glibc to free up unused malloc (or
> any heap allocations) would be very useful, because even if a program
> does "free" there is no guarantee the memory is returned to the kernel.

Yes, no guarantee.
but current glibc-malloc very frequently return memory to kernel.

glibc default behavior

1. over 1M memory: return memory just free(3)  called.
    (you can change threshold by MALLOC_MMAP_MAX_ environment)
2. more lower:         return memory when exist continuous 128k at heap tail.
    (you can change threashold by MALLOC_TRIM_THRESHOLD_ environment)

if you know very memory consumption by already freed memory situation,
please tell me situation detail and consumption memory size.

> I think that having a generic reservation framework is too complex, but
> hiding the details of /dev/mem_notify from applications is desirable.
> A simple wrapper (possibly part of glibc) to return the poll fd, or set
> up the signal is enough.

Agreed.
if large consumption situation exist, I'm behind you.


Thanks!

  reply	other threads:[~2008-02-11 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 15:55 [sample] mem_notify v6: usage example KOSAKI Motohiro
2008-02-09 16:07 ` Jon Masters
2008-02-09 16:46   ` KOSAKI Motohiro
2008-02-11 18:15     ` Andreas Dilger
2008-02-11 18:37       ` KOSAKI Motohiro [this message]
2008-02-10  1:30   ` Pavel Machek

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=2f11576a0802111037j4fe75e80l695f5a401ec93a7a@mail.gmail.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=a1426z@gawab.com \
    --cc=adilger@sun.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=daniel.spang@gmail.com \
    --cc=jonathan@jonmasters.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@kvack.org \
    --cc=pavel@ucw.cz \
    --cc=riel@redhat.com \
    --cc=zlynx@acm.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;
as well as URLs for NNTP newsgroup(s).