From: <leonid.moiseichuk@nokia.com>
To: kirill@shutemov.name, rientjes@google.com
Cc: glommer@parallels.com, anton.vorontsov@linaro.org,
penberg@kernel.org, mgorman@suse.de, kosaki.motohiro@gmail.com,
minchan@kernel.org, b.zolnierkie@samsung.com,
john.stultz@linaro.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org,
patches@linaro.org, kernel-team@android.com,
linux-man@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com,
mhocko@suse.cz, hannes@cmpxchg.org, tj@kernel.org
Subject: RE: [RFC v3 0/3] vmpressure_fd: Linux VM pressure notifications
Date: Wed, 21 Nov 2012 11:32:43 +0000 [thread overview]
Message-ID: <84FF21A720B0874AA94B46D76DB982690469CC00@008-AM1MPN1-002.mgdnok.nokia.com> (raw)
In-Reply-To: <20121121093056.GA31882@shutemov.name>
-----Original Message-----
From: ext Kirill A. Shutemov [mailto:kirill@shutemov.name]
Sent: 21 November, 2012 11:31
...
BTW, there's interface for OOM notification in memcg. See oom_control.
I guess other pressure levels can also fit to the interface.
---
Hi,
I have tracking this conversation very little, but as person somehow related to this round of development and requestor of memcg notification mechanism in past (Kirill implemented that) I have to point there are reasons not to use memcg. The situation in latest kernels could be different but practically in past the following troubles were observed with memcg:
1. by default memcg is turned off on Android (at least on 4.1 I see it)
2. you need to produce memory partitioning, and that maybe non-trivial task in general case when apps/use cases are not so limited
3. memcg takes into account cached memory. Yes, you can play with MADV_DONTNEED as it was mentioned but in generic case that is insane
4. memcg need be extended in a way you need to track some other kinds of memory
5. in case of situation in some partition changed fast (e.g. process moved to another partition) it may cause pages trashing and device lock. The in-kernel lock was fixed in May 2012, but even pages trashing knock out device number of seconds (even minutes).
Thus, I would prefer to avoid memcg even it is powerful feature.
Memory notifications are quite irrelevant to partitioning and cgroups. The use-case is related to user-space handling low memory. Meaning the functionality should be accurate with specific granularity (e.g. 1 MB) and time (0.25s is OK) but better to have it as simple and battery-friendly. I prefer to have pseudo-device-based text API because it is easy to debug and investigate. It would be nice if it will be possible to use simple scripting to point what kind of memory on which levels need to be tracked but private/shared dirty is #1 and memcg cannot handle it.
There are two use-cases related to this notification feature:
1. direct usage -> reaction to coming low memory situation and do something ahead of time. E.g. system calibrated to 80% dirty memory border, and if we crossed it we can compensate device slowness by flushing application caches, closing background images even notify user but without killing apps by any OOM killer and corruption unsaved data.
2. permission to do some heavy actions. If memory level is low enough for some application use case (e.g. 50 MB available) application can start heavy use-case, otherwise - do something to prevent potential problems.
So, seems to me, the levels depends from application memory usage e.g. calculator does not need memory information but browser and image gallery needs. Thus, tracking daemons in user-space looks as overhead, and such construction we used in n900 (ke-recv -> dbus -> apps) is quite fragile and slow.
These bits [1] was developed initially for n9 to replace memcg notifications with great support of kernel community about a year ago. Unfortunately for n9 I was a bit late and code was integrated to another product's kernel (say M), but at last Summer project M was forced to die due to moving product line to W. Practically arm device produced signals ON/OFF which fit well into space/time requirements, so I have what I need. Even it is quite primitive code but I prefer do not over-engineering complexity without necessity.
Best Wishes,
Leonid
PS: but seems code related to vmpressure_fd solves some other problem so you can ignore my speech.
[1] http://maemo.gitorious.org/maemo-tools/libmemnotify/blobs/master/src/kernel/memnotify.c
--
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>
next prev parent reply other threads:[~2012-11-21 11:33 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-07 10:53 Anton Vorontsov
2012-11-07 11:01 ` [RFC 1/3] mm: Add " Anton Vorontsov
2012-11-08 17:01 ` Mel Gorman
2012-11-08 17:14 ` Kirill A. Shutemov
2012-11-13 18:38 ` Jonathan Corbet
2012-11-07 11:01 ` [RFC 2/3] tools/testing: Add vmpressure-test utility Anton Vorontsov
2012-11-07 11:01 ` [RFC 3/3] man-pages: Add man page for vmpressure_fd(2) Anton Vorontsov
2012-11-07 14:19 ` Rik van Riel
2012-11-20 5:52 ` Andrew Morton
2012-11-20 6:24 ` Anton Vorontsov
2012-11-20 18:12 ` David Rientjes
2012-11-21 15:01 ` Mel Gorman
2012-11-21 19:39 ` Andrew Morton
2012-11-22 8:52 ` Pekka Enberg
2012-11-07 11:21 ` [RFC v3 0/3] vmpressure_fd: Linux VM pressure notifications Kirill A. Shutemov
2012-11-07 11:28 ` Pekka Enberg
2012-11-07 11:43 ` Kirill A. Shutemov
2012-11-15 3:21 ` David Rientjes
2012-11-15 3:39 ` Anton Vorontsov
2012-11-15 3:59 ` David Rientjes
2012-11-15 7:34 ` Anton Vorontsov
2012-11-15 8:11 ` David Rientjes
2012-11-15 8:52 ` Anton Vorontsov
2012-11-15 21:25 ` David Rientjes
2012-11-16 9:33 ` Glauber Costa
2012-11-16 20:04 ` David Rientjes
2012-11-16 21:12 ` Glauber Costa
2012-11-16 21:57 ` David Rientjes
2012-11-17 1:21 ` Anton Vorontsov
2012-11-18 22:53 ` David Rientjes
2012-11-19 14:00 ` Glauber Costa
2012-11-19 13:57 ` Glauber Costa
2012-11-20 18:02 ` David Rientjes
2012-11-21 9:30 ` Kirill A. Shutemov
2012-11-21 11:32 ` leonid.moiseichuk [this message]
2012-11-21 11:54 ` Glauber Costa
2012-11-21 13:48 ` leonid.moiseichuk
2012-11-26 21:35 ` Michal Hocko
2012-11-19 14:19 ` Glauber Costa
2012-11-20 18:23 ` David Rientjes
2012-11-21 8:27 ` Glauber Costa
2012-11-21 8:46 ` Anton Vorontsov
2012-11-21 9:25 ` Glauber Costa
2012-11-07 11:43 ` Anton Vorontsov
2012-11-07 12:11 ` Kirill A. Shutemov
2012-11-07 12:28 ` Anton Vorontsov
2012-11-07 17:20 ` Greg Thelen
2012-11-07 20:52 ` Pekka Enberg
2012-11-07 11:30 ` Pekka Enberg
2012-11-07 11:31 ` Pekka Enberg
2012-11-07 12:06 ` Anton Vorontsov
2012-11-09 8:32 ` Luiz Capitulino
2012-11-09 9:04 ` Anton Vorontsov
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=84FF21A720B0874AA94B46D76DB982690469CC00@008-AM1MPN1-002.mgdnok.nokia.com \
--to=leonid.moiseichuk@nokia.com \
--cc=anton.vorontsov@linaro.org \
--cc=b.zolnierkie@samsung.com \
--cc=glommer@parallels.com \
--cc=hannes@cmpxchg.org \
--cc=john.stultz@linaro.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kernel-team@android.com \
--cc=kirill@shutemov.name \
--cc=kosaki.motohiro@gmail.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=patches@linaro.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=tj@kernel.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