From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx162.postini.com [74.125.245.162]) by kanga.kvack.org (Postfix) with SMTP id 836506B002B for ; Tue, 16 Oct 2012 04:21:22 -0400 (EDT) Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 182693EE0C5 for ; Tue, 16 Oct 2012 17:21:21 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id EFD1845DEC1 for ; Tue, 16 Oct 2012 17:21:20 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id D2F4845DEB2 for ; Tue, 16 Oct 2012 17:21:20 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id AA5051DB8045 for ; Tue, 16 Oct 2012 17:21:20 +0900 (JST) Received: from m1000.s.css.fujitsu.com (m1000.s.css.fujitsu.com [10.240.81.136]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id BBC951DB803E for ; Tue, 16 Oct 2012 17:21:19 +0900 (JST) Message-ID: <507D18D2.5020707@jp.fujitsu.com> Date: Tue, 16 Oct 2012 17:20:34 +0900 From: Kamezawa Hiroyuki MIME-Version: 1.0 Subject: Re: [PATCH v4 08/14] res_counter: return amount of charges after res_counter_uncharge References: <1349690780-15988-1-git-send-email-glommer@parallels.com> <1349690780-15988-9-git-send-email-glommer@parallels.com> In-Reply-To: <1349690780-15988-9-git-send-email-glommer@parallels.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mel Gorman , Suleiman Souhlal , Tejun Heo , cgroups@vger.kernel.org, Michal Hocko , Johannes Weiner , Greg Thelen , devel@openvz.org, Frederic Weisbecker (2012/10/08 19:06), Glauber Costa wrote: > It is useful to know how many charges are still left after a call to > res_counter_uncharge. While it is possible to issue a res_counter_read > after uncharge, this can be racy. > > If we need, for instance, to take some action when the counters drop > down to 0, only one of the callers should see it. This is the same > semantics as the atomic variables in the kernel. > > Since the current return value is void, we don't need to worry about > anything breaking due to this change: nobody relied on that, and only > users appearing from now on will be checking this value. > > Signed-off-by: Glauber Costa > CC: Michal Hocko > CC: Johannes Weiner > CC: Suleiman Souhlal > CC: Kamezawa Hiroyuki > --- > Documentation/cgroups/resource_counter.txt | 7 ++++--- > include/linux/res_counter.h | 12 +++++++----- > kernel/res_counter.c | 20 +++++++++++++------- > 3 files changed, 24 insertions(+), 15 deletions(-) Acked-by: KAMEZAWA Hiroyuki -- 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: email@kvack.org