From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757288Ab2ASJVX (ORCPT ); Thu, 19 Jan 2012 04:21:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18239 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757039Ab2ASJVP (ORCPT ); Thu, 19 Jan 2012 04:21:15 -0500 Message-ID: <4F17E058.8020008@redhat.com> Date: Thu, 19 Jan 2012 11:20:24 +0200 From: Ronen Hod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Pekka Enberg CC: leonid.moiseichuk@nokia.com, 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, mtosatti@redhat.com, akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com Subject: Re: [RFC 1/3] /dev/low_mem_notify References: <1326788038-29141-1-git-send-email-minchan@kernel.org> <1326788038-29141-2-git-send-email-minchan@kernel.org> <4F15A34F.40808@redhat.com> <84FF21A720B0874AA94B46D76DB98269045596AE@008-AM1MPN1-003.mgdnok.nokia.com> <84FF21A720B0874AA94B46D76DB98269045596EA@008-AM1MPN1-003.mgdnok.nokia.com> <84FF21A720B0874AA94B46D76DB982690455978C@008-AM1MPN1-003.mgdnok.nokia.com> <4F175706.8000808@redhat.com> <4F17DCED.4020908@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/19/2012 11:10 AM, Pekka Enberg wrote: > On Thu, Jan 19, 2012 at 11:05 AM, Ronen Hod wrote: >>>> I believe that it will be best if the kernel publishes an ideal >>>> number_of_free_pages (in /proc/meminfo or whatever). Such number is easy to >>>> work with since this is what applications do, they free pages. Applications >>>> will be able to refer to this number from their garbage collector, or before >>>> allocating memory also if they did not get a notification, and it is also >>>> useful if several applications free memory at the same time. >>> 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. Thanks, Ronen. > > Pekka