From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 12/12] bdi: use bdi_stat_sum() for more accurate debugfs stats Date: Thu, 19 Nov 2009 16:17:43 +0800 Message-ID: <20091119081743.GG5922@localhost> References: <20091118082648.140755818@intel.com> <20091118082846.921451469@intel.com> <1258540729.3918.211.camel@laptop> <20091119075944.GA5922@localhost> <1258618324.3931.35.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , "linux-fsdevel@vger.kernel.org" To: Peter Zijlstra Return-path: Received: from mga03.intel.com ([143.182.124.21]:49797 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752729AbZKSIRj (ORCPT ); Thu, 19 Nov 2009 03:17:39 -0500 Content-Disposition: inline In-Reply-To: <1258618324.3931.35.camel@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Nov 19, 2009 at 04:12:04PM +0800, Peter Zijlstra wrote: > On Thu, 2009-11-19 at 15:59 +0800, Wu Fengguang wrote: > > On Wed, Nov 18, 2009 at 06:38:49PM +0800, Peter Zijlstra wrote: > > > On Wed, 2009-11-18 at 16:27 +0800, Wu Fengguang wrote: > > > > plain text document attachment (bdi-debug-dump-sum.patch) > > > > CC: Peter Zijlstra > > > > Signed-off-by: Wu Fengguang > > > > --- > > > > mm/backing-dev.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > --- linux.orig/mm/backing-dev.c 2009-11-18 16:25:28.000000000 +0800 > > > > +++ linux/mm/backing-dev.c 2009-11-18 16:26:10.000000000 +0800 > > > > @@ -104,8 +104,8 @@ static int bdi_debug_stats_show(struct s > > > > "wb_mask: %8lx\n" > > > > "wb_list: %8u\n" > > > > "wb_cnt: %8u\n", > > > > - (unsigned long) K(bdi_stat(bdi, BDI_WRITEBACK)), > > > > - (unsigned long) K(bdi_stat(bdi, BDI_RECLAIMABLE)), > > > > + (unsigned long) K(bdi_stat_sum(bdi, BDI_WRITEBACK)), > > > > + (unsigned long) K(bdi_stat_sum(bdi, BDI_RECLAIMABLE)), > > > > K(bdi_thresh), K(dirty_thresh), > > > > K(background_thresh), nr_wb, nr_dirty, nr_io, nr_more_io, > > > > !list_empty(&bdi->bdi_list), bdi->state, bdi->wb_mask, > > > > > > > > > > Is this really important? This patch is basically a local DoS for large > > > machines. > > > > I did this patch after seeing inaccurate exported numbers, > > it may be confusing.. > > > > > Imagine someone doing: > > > > > > while :; do cat /debug/bdi/*/stats; done > > > > > > on a 512 cpu box. > > > > Yes there will be overheads. However it's always possible to > > create local DoS with some other kind of busy loop? > > Preferably not of the kind that renders your box unusable, esp by unpriv > users. > > But yes there are probably a few local DoS' around, but I don't think > that warrants adding another one. OK I'll drop this patch. I'm not feeling strong on either way. Andrew/Jens, do you prefer for me to repost the non-fs-specific patches? Thanks, Fengguang