public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Mingming Cao <cmm@us.ibm.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	tytso@mit.edu, sandeen@redhat.com, linux-ext4@vger.kernel.org
Subject: Re: [RFC PATCH] percpu_counters: make fbc->count read atomic on 32 bit architecture
Date: Fri, 22 Aug 2008 20:33:22 +0200	[thread overview]
Message-ID: <1219430002.21326.22.camel@lappy.programming.kicks-ass.net> (raw)
In-Reply-To: <1219429794.6306.34.camel@mingming-laptop>

On Fri, 2008-08-22 at 11:29 -0700, Mingming Cao wrote:
> 在 2008-08-22五的 19:04 +0530,Aneesh Kumar K.V写道:
> > fbc->count is of type s64. The change was introduced by
> > 0216bfcffe424a5473daa4da47440881b36c1f4 which changed the type
> > from long to s64. Moving to s64 also means on 32 bit architectures
> > we can get wrong values on fbc->count.
> > 
> > percpu_counter_read is used within interrupt context also. So
> > use the irq safe version of spinlock while reading
> > 
> 
> It's quit expensive to hold the lock to do percpu_counter_read  on 32
> bit arch, the common case.
>  
> The type of the global counter and local counter were explictly
> specified using s64 and s32 The global counter is changed from long to
> s64, while the local counter is changed from long to s32, so we could
> avoid doing 64 bit update in most cases.  After all the percpu counter
> read is not a accurate value. 

seqlocks come to mind.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2008-08-22 18:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 13:34 [RFC PATCH] percpu_counters: make fbc->count read atomic on 32 bit architecture Aneesh Kumar K.V
2008-08-22 13:34 ` [RFC PATCH] percpu_counters: Add new function percpu_counter_sum_and_sub Aneesh Kumar K.V
2008-08-22 13:34   ` [RFC PATCH] ext4: Make sure all the block allocation patch reserve blocks Aneesh Kumar K.V
2008-08-22 18:22     ` Mingming Cao
2008-08-22 18:01   ` [RFC PATCH] percpu_counters: Add new function percpu_counter_sum_and_sub Mingming Cao
2008-08-22 18:29 ` [RFC PATCH] percpu_counters: make fbc->count read atomic on 32 bit architecture Mingming Cao
2008-08-22 18:33   ` Peter Zijlstra [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=1219430002.21326.22.camel@lappy.programming.kicks-ass.net \
    --to=a.p.zijlstra@chello.nl \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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