All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <anton.vorontsov@linaro.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: "KOSAKI Motohiro" <kosaki.motohiro@jp.fujitsu.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Rik van Riel" <riel@redhat.com>, "Pavel Machek" <pavel@ucw.cz>,
	"Greg Kroah-Hartman" <gregkh@suse.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David Rientjes" <rientjes@google.com>,
	"John Stultz" <john.stultz@linaro.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: Android low memory killer vs. memory pressure notifications
Date: Tue, 20 Dec 2011 06:16:47 +0400	[thread overview]
Message-ID: <20111220021647.GB4531@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20111219121255.GA2086@tiehlicka.suse.cz>

On Mon, Dec 19, 2011 at 01:12:55PM +0100, Michal Hocko wrote:
> [Didn't get to the patch yet but a comment on memcg]
> 
> On Mon 19-12-11 06:53:28, Anton Vorontsov wrote:
> [...]
> > - Use memory controller cgroup (CGROUP_MEM_RES_CTLR) notifications from
> >   the kernel side, plus userland "manager" that would kill applications.
> > 
> >   The main downside of this approach is that mem_cg needs 20 bytes per
> >   page (on a 32 bit machine). So on a 32 bit machine with 4K pages
> >   that's approx. 0.5% of RAM, or, in other words, 5MB on a 1GB machine.
> 
> page_cgroup is 16B per page and with the current Johannes' memcg
> naturalization work (in the mmotm tree) we are down to 8B per page (we
> got rid of lru). Kamezawa has some patches to get rid of the flags so we
> will be down to 4B per page on 32b. Is this still too much?
> I would be really careful about a yet another lowmem notification
> mechanism.

4 bytes (1MB wastage on a 1GB machine) sounds much better. If there are no
other downsides of using cgroups-based low memory killer, then maybe it's
not worth doing yet another low memory notification stuff.

> >   0.5% doesn't sound too bad, but 5MB does, quite a little bit. So,
> >   mem_cg feels like an overkill for this simple task (see the driver at
> >   the very bottom).
> 
> Why is it an overkill? I think that having 2 groups (active and
> inactive) and move tasks between then sounds quite elegant.

Yep, that was the original idea. But back then mem_cg was way too costly,
so nobody seriously considered this as a solution.

Thanks,

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Anton Vorontsov <anton.vorontsov@linaro.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: "KOSAKI Motohiro" <kosaki.motohiro@jp.fujitsu.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Rik van Riel" <riel@redhat.com>, "Pavel Machek" <pavel@ucw.cz>,
	"Greg Kroah-Hartman" <gregkh@suse.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David Rientjes" <rientjes@google.com>,
	"John Stultz" <john.stultz@linaro.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: Android low memory killer vs. memory pressure notifications
Date: Tue, 20 Dec 2011 06:16:47 +0400	[thread overview]
Message-ID: <20111220021647.GB4531@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20111219121255.GA2086@tiehlicka.suse.cz>

On Mon, Dec 19, 2011 at 01:12:55PM +0100, Michal Hocko wrote:
> [Didn't get to the patch yet but a comment on memcg]
> 
> On Mon 19-12-11 06:53:28, Anton Vorontsov wrote:
> [...]
> > - Use memory controller cgroup (CGROUP_MEM_RES_CTLR) notifications from
> >   the kernel side, plus userland "manager" that would kill applications.
> > 
> >   The main downside of this approach is that mem_cg needs 20 bytes per
> >   page (on a 32 bit machine). So on a 32 bit machine with 4K pages
> >   that's approx. 0.5% of RAM, or, in other words, 5MB on a 1GB machine.
> 
> page_cgroup is 16B per page and with the current Johannes' memcg
> naturalization work (in the mmotm tree) we are down to 8B per page (we
> got rid of lru). Kamezawa has some patches to get rid of the flags so we
> will be down to 4B per page on 32b. Is this still too much?
> I would be really careful about a yet another lowmem notification
> mechanism.

4 bytes (1MB wastage on a 1GB machine) sounds much better. If there are no
other downsides of using cgroups-based low memory killer, then maybe it's
not worth doing yet another low memory notification stuff.

> >   0.5% doesn't sound too bad, but 5MB does, quite a little bit. So,
> >   mem_cg feels like an overkill for this simple task (see the driver at
> >   the very bottom).
> 
> Why is it an overkill? I think that having 2 groups (active and
> inactive) and move tasks between then sounds quite elegant.

Yep, that was the original idea. But back then mem_cg was way too costly,
so nobody seriously considered this as a solution.

Thanks,

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

  parent reply	other threads:[~2011-12-20  2:16 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19  2:53 Android low memory killer vs. memory pressure notifications Anton Vorontsov
2011-12-19  2:53 ` Anton Vorontsov
2011-12-19  7:48 ` Minchan Kim
2011-12-19  7:48   ` Minchan Kim
2011-12-19 19:05   ` David Rientjes
2011-12-19 19:05     ` David Rientjes
2011-12-19 10:39 ` Alan Cox
2011-12-19 10:39   ` Alan Cox
2011-12-19 16:16   ` KOSAKI Motohiro
2011-12-19 16:16     ` KOSAKI Motohiro
2011-12-19 16:24     ` Rik van Riel
2011-12-19 16:24       ` Rik van Riel
2011-12-19 12:12 ` Michal Hocko
2011-12-19 12:12   ` Michal Hocko
2011-12-19 19:12   ` David Rientjes
2011-12-19 19:12     ` David Rientjes
2011-12-20 14:56     ` Anton Vorontsov
2011-12-20 14:56       ` Anton Vorontsov
2011-12-20 21:36       ` David Rientjes
2011-12-20 21:36         ` David Rientjes
2011-12-21  0:28         ` Anton Vorontsov
2011-12-21  0:28           ` Anton Vorontsov
2011-12-21  1:14           ` Frank Rowand
2011-12-21  1:14             ` Frank Rowand
2011-12-21  2:07             ` Anton Vorontsov
2011-12-21  2:07               ` Anton Vorontsov
2011-12-21  2:30               ` Frank Rowand
2011-12-21  2:30                 ` Frank Rowand
2011-12-21 23:41                 ` Anton Vorontsov
2011-12-21 23:41                   ` Anton Vorontsov
2011-12-22  1:16             ` KOSAKI Motohiro
2011-12-22  1:16               ` KOSAKI Motohiro
2011-12-22 18:53               ` Frank Rowand
2011-12-22 18:53                 ` Frank Rowand
2011-12-21  2:50           ` David Rientjes
2011-12-21  2:50             ` David Rientjes
2011-12-20  2:16   ` Anton Vorontsov [this message]
2011-12-20  2:16     ` Anton Vorontsov
2011-12-19 16:11 ` KOSAKI Motohiro
2011-12-19 16:11   ` KOSAKI Motohiro
2011-12-20  0:30   ` Hiroyuki Kamezawa
2011-12-20  0:30     ` Hiroyuki Kamezawa
2011-12-19 17:30 ` KOSAKI Motohiro
2011-12-19 17:30   ` KOSAKI Motohiro
2011-12-19 17:34   ` KOSAKI Motohiro
2011-12-19 17:34     ` KOSAKI Motohiro

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=20111220021647.GB4531@oksana.dev.rtsoft.ru \
    --to=anton.vorontsov@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=arve@android.com \
    --cc=gregkh@suse.de \
    --cc=hannes@cmpxchg.org \
    --cc=john.stultz@linaro.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=pavel@ucw.cz \
    --cc=riel@redhat.com \
    --cc=rientjes@google.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 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.