From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754937AbbCSKMo (ORCPT ); Thu, 19 Mar 2015 06:12:44 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:34299 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754167AbbCSKMJ (ORCPT ); Thu, 19 Mar 2015 06:12:09 -0400 Date: Thu, 19 Mar 2015 13:12:05 +0300 From: Cyrill Gorcunov To: Vladimir Davydov Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Greg Thelen , Michel Lespinasse , David Rientjes , Pavel Emelyanov , Jonathan Corbet , linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm: idle memory tracking Message-ID: <20150319101205.GC27066@moon> References: <0b70e70137aa5232cce44a69c0b5e320f2745f7d.1426706637.git.vdavydov@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b70e70137aa5232cce44a69c0b5e320f2745f7d.1426706637.git.vdavydov@parallels.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2015 at 11:44:36PM +0300, Vladimir Davydov wrote: > Knowing the portion of memory that is not used by a certain application > or memory cgroup (idle memory) can be useful for partitioning the system > efficiently. Currently, the only means to estimate the amount of idle > memory provided by the kernel is /proc/PID/clear_refs. However, it has > two serious shortcomings: > > - it does not count unmapped file pages > - it affects the reclaimer logic > > This patch attempts to provide the userspace with the means to track > idle memory without the above mentioned limitations. ... > +static void set_mem_idle(void) > +{ > + int nid; > + > + for_each_online_node(nid) > + set_mem_idle_node(nid); > +} Vladimir, might we need get_online_mems/put_online_mems here, or if node gets offline this wont be a problem? (Asking because i don't know).