From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668Ab2GIBho (ORCPT ); Sun, 8 Jul 2012 21:37:44 -0400 Received: from mga01.intel.com ([192.55.52.88]:34388 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751209Ab2GIBhn (ORCPT ); Sun, 8 Jul 2012 21:37:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="174836375" Date: Mon, 9 Jul 2012 09:37:34 +0800 From: Fengguang Wu To: Johannes Weiner Cc: Kamezawa Hiroyuki , Sha Zhengju , linux-mm@kvack.org, cgroups@vger.kernel.org, gthelen@google.com, yinghan@google.com, akpm@linux-foundation.org, mhocko@suse.cz, linux-kernel@vger.kernel.org, Sha Zhengju Subject: Re: [PATCH 6/7] memcg: add per cgroup writeback pages accounting Message-ID: <20120709013734.GA8880@localhost> References: <1340880885-5427-1-git-send-email-handai.szj@taobao.com> <1340881525-5835-1-git-send-email-handai.szj@taobao.com> <4FF291BE.7030509@jp.fujitsu.com> <20120708144459.GA18272@localhost> <20120708230100.GA5340@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120708230100.GA5340@cmpxchg.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2012 at 01:01:00AM +0200, Johannes Weiner wrote: > On Sun, Jul 08, 2012 at 10:44:59PM +0800, Fengguang Wu wrote: > > On Tue, Jul 03, 2012 at 03:31:26PM +0900, KAMEZAWA Hiroyuki wrote: > > > (2012/06/28 20:05), Sha Zhengju wrote: > > > > From: Sha Zhengju > > > > > > > > Similar to dirty page, we add per cgroup writeback pages accounting. The lock > > > > rule still is: > > > > mem_cgroup_begin_update_page_stat() > > > > modify page WRITEBACK stat > > > > mem_cgroup_update_page_stat() > > > > mem_cgroup_end_update_page_stat() > > > > > > > > There're two writeback interface to modify: test_clear/set_page_writeback. > > > > > > > > Signed-off-by: Sha Zhengju > > > > > > Seems good to me. BTW, you named macros as MEM_CGROUP_STAT_FILE_XXX > > > but I wonder these counters will be used for accounting swap-out's dirty pages.. > > > > > > STAT_DIRTY, STAT_WRITEBACK ? do you have better name ? > > > > Perhaps we can follow the established "enum zone_stat_item" names: > > > > NR_FILE_DIRTY, > > NR_WRITEBACK, > > > > s/NR_/MEM_CGROUP_STAT_/ > > > > The names indicate that dirty pages for anonymous pages are not > > accounted (by __set_page_dirty_no_writeback()). While the writeback > > pages accounting include both the file/anon pages. > > > > Ah then we'll need to update the document in patch 0 accordingly. This > > may sound a bit tricky to the users.. > > We already report the global one as "nr_dirty", though. Please don't > give the memcg one a different name. > > The enum naming is not too critical, but it would be nice to have it > match the public name. Fair enough. The public name obviously has more weight :) Thanks, Fengguang From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx140.postini.com [74.125.245.140]) by kanga.kvack.org (Postfix) with SMTP id 9765A6B0075 for ; Sun, 8 Jul 2012 21:37:43 -0400 (EDT) Date: Mon, 9 Jul 2012 09:37:34 +0800 From: Fengguang Wu Subject: Re: [PATCH 6/7] memcg: add per cgroup writeback pages accounting Message-ID: <20120709013734.GA8880@localhost> References: <1340880885-5427-1-git-send-email-handai.szj@taobao.com> <1340881525-5835-1-git-send-email-handai.szj@taobao.com> <4FF291BE.7030509@jp.fujitsu.com> <20120708144459.GA18272@localhost> <20120708230100.GA5340@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120708230100.GA5340@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Kamezawa Hiroyuki , Sha Zhengju , linux-mm@kvack.org, cgroups@vger.kernel.org, gthelen@google.com, yinghan@google.com, akpm@linux-foundation.org, mhocko@suse.cz, linux-kernel@vger.kernel.org, Sha Zhengju On Mon, Jul 09, 2012 at 01:01:00AM +0200, Johannes Weiner wrote: > On Sun, Jul 08, 2012 at 10:44:59PM +0800, Fengguang Wu wrote: > > On Tue, Jul 03, 2012 at 03:31:26PM +0900, KAMEZAWA Hiroyuki wrote: > > > (2012/06/28 20:05), Sha Zhengju wrote: > > > > From: Sha Zhengju > > > > > > > > Similar to dirty page, we add per cgroup writeback pages accounting. The lock > > > > rule still is: > > > > mem_cgroup_begin_update_page_stat() > > > > modify page WRITEBACK stat > > > > mem_cgroup_update_page_stat() > > > > mem_cgroup_end_update_page_stat() > > > > > > > > There're two writeback interface to modify: test_clear/set_page_writeback. > > > > > > > > Signed-off-by: Sha Zhengju > > > > > > Seems good to me. BTW, you named macros as MEM_CGROUP_STAT_FILE_XXX > > > but I wonder these counters will be used for accounting swap-out's dirty pages.. > > > > > > STAT_DIRTY, STAT_WRITEBACK ? do you have better name ? > > > > Perhaps we can follow the established "enum zone_stat_item" names: > > > > NR_FILE_DIRTY, > > NR_WRITEBACK, > > > > s/NR_/MEM_CGROUP_STAT_/ > > > > The names indicate that dirty pages for anonymous pages are not > > accounted (by __set_page_dirty_no_writeback()). While the writeback > > pages accounting include both the file/anon pages. > > > > Ah then we'll need to update the document in patch 0 accordingly. This > > may sound a bit tricky to the users.. > > We already report the global one as "nr_dirty", though. Please don't > give the memcg one a different name. > > The enum naming is not too critical, but it would be nice to have it > match the public name. Fair enough. The public name obviously has more weight :) Thanks, Fengguang -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fengguang Wu Subject: Re: [PATCH 6/7] memcg: add per cgroup writeback pages accounting Date: Mon, 9 Jul 2012 09:37:34 +0800 Message-ID: <20120709013734.GA8880@localhost> References: <1340880885-5427-1-git-send-email-handai.szj@taobao.com> <1340881525-5835-1-git-send-email-handai.szj@taobao.com> <4FF291BE.7030509@jp.fujitsu.com> <20120708144459.GA18272@localhost> <20120708230100.GA5340@cmpxchg.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20120708230100.GA5340-druUgvl0LCNAfugRpC6u6w@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Johannes Weiner Cc: Kamezawa Hiroyuki , Sha Zhengju , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, mhocko-AlSwsSmVLrQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sha Zhengju On Mon, Jul 09, 2012 at 01:01:00AM +0200, Johannes Weiner wrote: > On Sun, Jul 08, 2012 at 10:44:59PM +0800, Fengguang Wu wrote: > > On Tue, Jul 03, 2012 at 03:31:26PM +0900, KAMEZAWA Hiroyuki wrote: > > > (2012/06/28 20:05), Sha Zhengju wrote: > > > > From: Sha Zhengju > > > > > > > > Similar to dirty page, we add per cgroup writeback pages accounting. The lock > > > > rule still is: > > > > mem_cgroup_begin_update_page_stat() > > > > modify page WRITEBACK stat > > > > mem_cgroup_update_page_stat() > > > > mem_cgroup_end_update_page_stat() > > > > > > > > There're two writeback interface to modify: test_clear/set_page_writeback. > > > > > > > > Signed-off-by: Sha Zhengju > > > > > > Seems good to me. BTW, you named macros as MEM_CGROUP_STAT_FILE_XXX > > > but I wonder these counters will be used for accounting swap-out's dirty pages.. > > > > > > STAT_DIRTY, STAT_WRITEBACK ? do you have better name ? > > > > Perhaps we can follow the established "enum zone_stat_item" names: > > > > NR_FILE_DIRTY, > > NR_WRITEBACK, > > > > s/NR_/MEM_CGROUP_STAT_/ > > > > The names indicate that dirty pages for anonymous pages are not > > accounted (by __set_page_dirty_no_writeback()). While the writeback > > pages accounting include both the file/anon pages. > > > > Ah then we'll need to update the document in patch 0 accordingly. This > > may sound a bit tricky to the users.. > > We already report the global one as "nr_dirty", though. Please don't > give the memcg one a different name. > > The enum naming is not too critical, but it would be nice to have it > match the public name. Fair enough. The public name obviously has more weight :) Thanks, Fengguang