From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH] quota: Convert quota statistics to generic percpu_counter Date: Tue, 25 May 2010 15:47:00 +0200 Message-ID: <20100525134700.GA3783@quack.suse.cz> References: <87ocg4kyng.fsf@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-fsdevel@vger.kernel.org To: Dmitry Monakhov Return-path: Received: from cantor2.suse.de ([195.135.220.15]:56775 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757364Ab0E0Px2 (ORCPT ); Thu, 27 May 2010 11:53:28 -0400 Content-Disposition: inline In-Reply-To: <87ocg4kyng.fsf@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 25-05-10 15:29:23, Dmitry Monakhov wrote: > Generic pcpu counter has some memory overhead but it is negligible for > modern systems, and embedded systems compiles without quota support. > And code reuse is always good thing. This patch should fix complain > from preemptive kernels which was introduced by dde9588853b1bde ... > static ctl_table fs_dqstats_table[] = { > { > .procname = "lookups", > .data = &dqstats.stat[DQST_LOOKUPS], > - .maxlen = sizeof(int), > + .maxlen = sizeof(s64), You use proc_dounlongvec_minmax so .maxlen should be sizeof(unsigned long)... > @@ -253,29 +252,12 @@ enum { > }; > > struct dqstats { > - int stat[_DQST_DQSTAT_LAST]; > + struct percpu_counter cntp[_DQST_DQSTAT_LAST]; > + s64 stat[_DQST_DQSTAT_LAST]; ^^^ And here you should have unsigned long as well. Otherwise you would see the value as two 32-bit numbers on 32-bit archs. Honza -- Jan Kara SUSE Labs, CR