From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [PATCH] fs: use approximate counter values for inodes and dentries. (was Re: [patch] fs: use fast counters for vfs caches) Date: Thu, 9 Dec 2010 23:24:38 +1100 Message-ID: References: <20101129105733.GA3241@amd> <20101209054343.GA8259@dastard> <20101209061644.GA3667@amd> <20101209074503.GD8259@dastard> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nick Piggin , linux-fsdevel@vger.kernel.org, Linus Torvalds , Al Viro , Christoph Hellwig To: Dave Chinner Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:45593 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754793Ab0LIMYk convert rfc822-to-8bit (ORCPT ); Thu, 9 Dec 2010 07:24:40 -0500 Received: by wyb28 with SMTP id 28so2213657wyb.19 for ; Thu, 09 Dec 2010 04:24:39 -0800 (PST) In-Reply-To: <20101209074503.GD8259@dastard> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 9, 2010 at 6:45 PM, Dave Chinner wrot= e: > On Thu, Dec 09, 2010 at 05:16:44PM +1100, Nick Piggin wrote: >> On Thu, Dec 09, 2010 at 04:43:43PM +1100, Dave Chinner wrote: >> > On Mon, Nov 29, 2010 at 09:57:33PM +1100, Nick Piggin wrote: >> > > Hey, >> > > >> > > What was the reason behind not using my approach to use fast per= -cpu >> > > counters for inode and dentry counters, and instead using the >> > > percpu_counter lib (which is not useful unless very fast approxi= mate >> > > access to the global counter is required, or performance is not >> > > critical, which is somewhat of an oxymoron if you're using per-c= ounters >> > > in the first place). It is a difference between this: >> > >> > Hi Nick - sorry for being slow to answer this - I only just found >> > this email. >> > >> > The reason for using the generic counters is because the shrinkers >> > read the current value of the global counter on every call and hen= ce >> > they can be read thousands of times a second. The only way to do t= hat >> > efficiently is to use the approximately value the generic counters >> > provide. >> >> That is not what is happening, though, so I assume that no measureme= nts >> were done. >> >> In fact what happens now is that *both* type of counters use the cra= ppy >> percpu counter library, and the shrinkers actually do a per-cpu loop >> over the counters to get the sum. > > More likely that the overhead was hidden in the noise on the size of > machines most people test on. No. I was referring to the decision to use the heavyweight percpu_count= er code over the superior per cpu data that I was using. Also, the unrelated change to make nr_unused into per-cpu was not right, and I will revert that back to a global variable. (again, unless= you have numbers) > It certainly wasn't measurable on my > 16p machine, and nobody who reviewed it at the time (=D1=95everal peo= ple) > picked it up. So thanks for reviewing it - the simple fix is below. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > fs: Use approximate values for number of inodes and dentries > > From: Dave Chinner Nack. Can you please address my points and actually explain why this is better than my proposed approach please? -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html