linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] quota: Make quota stat accounting lockless.
Date: Tue, 27 Apr 2010 07:54:42 +0400	[thread overview]
Message-ID: <87aaspczy5.fsf@openvz.org> (raw)
In-Reply-To: <20100426201451.GH3673@quack.suse.cz> (Jan Kara's message of "Mon, 26 Apr 2010 22:14:51 +0200")

Jan Kara <jack@suse.cz> writes:

> On Mon 26-04-10 19:37:29, Jan Kara wrote:
>> On Mon 26-04-10 20:14:24, Dmitry Monakhov wrote:
>> > Jan Kara <jack@suse.cz> writes:
>> > 
>> > > 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.
>> > My initial goal was to keep inc/dec/read helpers together.
>> > We still need to export dqstats_pcpu. But if you prefer this style
>> > i'm ok with it. New version attached.
>>   OK, I've merged the new version (with a few whitespace fixes). Thanks.
>   The patch didn't compile for !CONFIG_SMP systems and also broke
> /proc/sys/fs/quota/warning file. Dmitry, could you be more careful next
> time, please? I've fixed that up and tested that it actually works.
> Attached is a resulting patch that I currently carry.
Hmm.. i dont wat to say... it was my unpredictable laziness effect.
Really sorry for wasting your time in that meaner. Will take more
efforts to avoid this in future.

      reply	other threads:[~2010-04-27  3:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23  5:31 [PATCH] quota: Make quota stat accounting lockless Dmitry Monakhov
2010-04-26 15:16 ` Jan Kara
2010-04-26 15:24   ` Jan Kara
2010-04-26 16:14     ` Dmitry Monakhov
2010-04-26 17:37       ` Jan Kara
2010-04-26 20:14         ` Jan Kara
2010-04-27  3:54           ` Dmitry Monakhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aaspczy5.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).