From: Ronen Hod <rhod@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: leonid.moiseichuk@nokia.com, penberg@kernel.org, riel@redhat.com,
minchan@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com,
mel@csn.ul.ie, rientjes@google.com, kosaki.motohiro@gmail.com,
hannes@cmpxchg.org, akpm@linux-foundation.org,
kosaki.motohiro@jp.fujitsu.com
Subject: Re: [RFC 1/3] /dev/low_mem_notify
Date: Tue, 24 Jan 2012 18:08:31 +0200 [thread overview]
Message-ID: <4F1ED77F.4090900@redhat.com> (raw)
In-Reply-To: <20120124153835.GA10990@amt.cnet>
On 01/24/2012 05:38 PM, Marcelo Tosatti wrote:
> On Thu, Jan 19, 2012 at 10:53:29AM +0000, leonid.moiseichuk@nokia.com wrote:
>>> -----Original Message-----
>>> From: ext Ronen Hod [mailto:rhod@redhat.com]
>>> Sent: 19 January, 2012 11:20
>>> To: Pekka Enberg
>> ...
>>>>>> Isn't
>>>>>>
>>>>>> /proc/sys/vm/min_free_kbytes
>>>>>>
>>>>>> pretty much just that?
>>>>> Would you suggest to use min_free_kbytes as the threshold for sending
>>>>> low_memory_notifications to applications, and separately as a target
>>>>> value for the applications' memory giveaway?
>>>> I'm not saying that the kernel should use it directly but it seems
>>>> like the kind of "ideal number of free pages" threshold you're
>>>> suggesting. So userspace can read that value and use it as the "number
>>>> of free pages" threshold for VM events, no?
>>> Yes, I like it. The rules of the game are simple and consistent all over, be it the
>>> alert threshold, voluntary poling by the apps, and for concurrent work by
>>> several applications.
>>> Well, as long as it provides a good indication for low_mem_pressure.
>> For me it doesn't look that have much sense. min_free_kbytes could be set from user-space (or auto-tuned by kernel) to keep some amount
>> of memory available for GFP_ATOMIC allocations. In case situation comes under pointed level kernel will reclaim memory from e.g. caches.
>>
>> > From potential user point of view the proposed API has number of lacks which would be nice to have implemented:
>> 1. rename this API from low_mem_pressure to something more related to notification and memory situation in system: memory_pressure, memnotify, memory_level etc. The word "low" is misleading here
>> 2. API must use deferred timers to prevent use-time impact. Deferred timer will be triggered only in case HW event or non-deferrable timer, so if device sleeps timer might be skipped and that is what expected for user-space
> Having userspace specify the "sample period" for low memory notification
> makes no sense. The frequency of notifications is a function of the
> memory pressure.
>
>> 3. API should be tunable for propagate changes when level is Up or Down, maybe both ways.
>
>> 4. to avoid triggering too much events probably has sense to filter according to amount of change but that is optional. If subscriber set timer to 1s the amount of events should not be very big.
>> 5. API must provide interface to request parameters e.g. available swap or free memory just to have some base.
> It would make the interface easier to use if it provided the number of
> pages to free, in the notification (kernel can calculate that as the
> delta between current_free_pages -> comfortable_free_pages relative to
> process RSS).
If you rely on the notification's argument you lose several features:
- Handling of notifications by several applications in parallel
- Voluntary application's decisions, such as cleanup or avoiding allocations, at the application's convenience.
- Iterative release loops, until there are enough free pages.
I believe that the notification should only serve as a trigger to run the cleanup.
Ronen.
>
>> 6. I do not understand how work with attributes performed ( ) but it has sense to use mask and fill requested attributes using mask and callback table i.e. if free pages requested - they are reported, otherwise not.
>> 7. would have sense to backport couple of attributes from memnotify.c
>>
>> I can submit couple of patches if some of proposals looks sane for everyone.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
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>
next prev parent reply other threads:[~2012-01-24 16:09 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-17 8:13 [RFC 0/3] low memory notify Minchan Kim
2012-01-17 8:13 ` [RFC 1/3] /dev/low_mem_notify Minchan Kim
2012-01-17 9:27 ` Pekka Enberg
2012-01-17 16:35 ` Rik van Riel
2012-01-17 18:51 ` Pekka Enberg
2012-01-17 19:30 ` Rik van Riel
2012-01-17 19:49 ` Pekka Enberg
2012-01-17 19:54 ` Pekka Enberg
2012-01-17 19:57 ` Pekka Enberg
2012-01-17 23:20 ` Minchan Kim
2012-01-18 7:16 ` Pekka Enberg
2012-01-18 7:49 ` Minchan Kim
2012-01-18 9:06 ` leonid.moiseichuk
2012-01-18 9:15 ` Pekka Enberg
2012-01-18 9:41 ` leonid.moiseichuk
2012-01-18 10:40 ` Pekka Enberg
2012-01-18 10:44 ` leonid.moiseichuk
2012-01-18 23:34 ` Ronen Hod
2012-01-19 7:25 ` Pekka Enberg
2012-01-19 9:05 ` Ronen Hod
2012-01-19 9:10 ` Pekka Enberg
2012-01-19 9:20 ` Ronen Hod
2012-01-19 10:53 ` leonid.moiseichuk
2012-01-19 11:07 ` Pekka Enberg
2012-01-19 11:54 ` leonid.moiseichuk
2012-01-19 11:59 ` Pekka Enberg
2012-01-19 12:06 ` Pekka Enberg
2012-01-24 15:38 ` Marcelo Tosatti
2012-01-24 16:08 ` Ronen Hod [this message]
2012-01-24 18:10 ` Marcelo Tosatti
2012-01-25 8:52 ` Ronen Hod
2012-01-25 10:12 ` Marcelo Tosatti
2012-01-25 10:48 ` Ronen Hod
2012-01-26 16:17 ` Marcelo Tosatti
2012-01-24 16:10 ` Pekka Enberg
2012-01-24 18:29 ` Marcelo Tosatti
2012-01-25 8:19 ` leonid.moiseichuk
2012-01-19 7:34 ` Pekka Enberg
2012-01-24 16:22 ` Arnd Bergmann
2012-01-18 14:30 ` Rik van Riel
2012-01-18 15:29 ` Pekka Enberg
2012-01-24 15:40 ` Marcelo Tosatti
2012-01-24 16:01 ` Pekka Enberg
2012-01-24 16:25 ` Arnd Bergmann
2012-01-24 18:32 ` Marcelo Tosatti
2012-01-24 21:57 ` Jonathan Corbet
2012-01-17 9:45 ` Pekka Enberg
2012-01-17 8:13 ` [RFC 2/3] vmscan hook Minchan Kim
2012-01-17 8:39 ` KAMEZAWA Hiroyuki
2012-01-17 9:13 ` Minchan Kim
2012-01-17 10:05 ` KAMEZAWA Hiroyuki
2012-01-17 23:08 ` Minchan Kim
2012-01-18 0:18 ` KAMEZAWA Hiroyuki
2012-01-18 14:17 ` Rik van Riel
2012-01-19 2:25 ` KAMEZAWA Hiroyuki
2012-01-19 14:42 ` Rik van Riel
2012-01-20 0:24 ` KAMEZAWA Hiroyuki
2012-01-17 8:13 ` [RFC 3/3] test program Minchan Kim
2012-01-17 14:38 ` [RFC 0/3] low memory notify Colin Walters
2012-01-17 15:04 ` Pekka Enberg
2012-01-17 16:44 ` Rik van Riel
2012-01-17 17:16 ` Olof Johansson
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=4F1ED77F.4090900@redhat.com \
--to=rhod@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@gmail.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=leonid.moiseichuk@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan@kernel.org \
--cc=mtosatti@redhat.com \
--cc=penberg@kernel.org \
--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 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).