From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH] quota: Make quota stat accounting lockless. Date: Mon, 26 Apr 2010 17:24:08 +0200 Message-ID: <20100426152407.GE3673@quack.suse.cz> References: <87ljceka4i.fsf@openvz.org> <20100426151623.GD3673@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Jan Kara To: Dmitry Monakhov Return-path: Received: from cantor2.suse.de ([195.135.220.15]:49401 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471Ab0DZPYH (ORCPT ); Mon, 26 Apr 2010 11:24:07 -0400 Content-Disposition: inline In-Reply-To: <20100426151623.GD3673@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 26-04-10 17:16:23, Jan Kara wrote: > On Fri 23-04-10 09:31:41, Dmitry Monakhov wrote: > > > > I've written this patch long time ago, it is pretty simple, and > > allow more non obvious locking optimization to be done later. > The patch looks OK to me. Will merge it. Hmm, maybe I spoke to soon. One question: > > +void dqstats_inc(unsigned int type) > > +{ > > +#ifdef CONFIG_SMP > > + per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]++; > > +#else > > + dqstats[type]++; > > +#endif > > +} > > + > > +void dqstats_dec(unsigned int type) > > +{ > > +#ifdef CONFIG_SMP > > + per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]--; > > +#else > > + dqstats[type]--; > > +#endif > > +} Why not make these two functions inline? Since they are used also from quota_tree.c and quota_v1.c, we'd need to move them to a quota.h header in that case. Honza Honza -- Jan Kara SUSE Labs, CR