From: richard kennedy <richard@rsk.demon.co.uk>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Theodore Ts'o" <tytso@mit.edu>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH, RFC] percpu_counters: make fbc->count read atomic on 32 bit architecture
Date: Tue, 07 Oct 2008 18:09:06 +0100 [thread overview]
Message-ID: <48EB97B2.3010406@rsk.demon.co.uk> (raw)
In-Reply-To: <1223373347.26330.19.camel@lappy.programming.kicks-ass.net>
Peter Zijlstra wrote:
....
> +static inline int atomic64_dec_and_test(atomic64_t *v)
> +{
> + int ret;
> +
> + write_seqlock(&v->slock);
> + v->counter--;
> + ret = !v->counter;
> + write_sequnlock(&v->slock);
> +
> + return ret;
> +}
> +
> +static inline int atomic64_add_and_test(atomic64_t *v)
> +{
> + int ret;
> +
> + write_seqlock(&v->slock);
> + v->counter++;
> + ret = !v->counter;
> + write_sequnlock(&v->slock);
> +
> + return ret;
> +}
would it be more logical to call this atomic64_inc_and_test to match the
above dec_and_test ?
regards
Richard
next prev parent reply other threads:[~2008-10-07 17:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1KmetO-00053M-5u@closure.thunk.org>
2008-10-07 6:23 ` [PATCH, RFC] percpu_counters: make fbc->count read atomic on 32 bit architecture Andrew Morton
2008-10-07 9:55 ` Peter Zijlstra
2008-10-07 17:09 ` richard kennedy [this message]
2008-10-07 17:22 ` Peter Zijlstra
2008-10-07 18:04 ` Andrew Morton
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=48EB97B2.3010406@rsk.demon.co.uk \
--to=richard@rsk.demon.co.uk \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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