linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Ravikiran G Thirumalai <kiran@scalex86.org>,
	Christoph Lameter <clameter@sgi.com>,
	akpm@osdl.org, Laurent Vivier <Laurent.Vivier@bull.net>,
	linux-kernel@vger.kernel.org,
	ext2-devel <ext2-devel@lists.sourceforge.net>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [Ext2-devel] Re: [RFC][PATCH 0/3] ext3 percpu counter fixes to suppport for ext3 unsigned long type free blocks counter
Date: Wed, 12 Apr 2006 15:50:27 -0600	[thread overview]
Message-ID: <20060412215027.GO17364@schatzie.adilger.int> (raw)
In-Reply-To: <1144877315.3722.26.camel@dyn9047017067.beaverton.ibm.com>

On Apr 12, 2006  14:28 -0700, Mingming Cao wrote:
> where the check for unsigned long overflow is only turned on 32 bit
> platforms.
> 
> > Or make the counter s64? so that it stays 64 bit on all arches? 
> > 
> 
> Well, don't we have the problem : 64 bit counter add/dec/update is not
> always atomic on all 32 bit platforms? There are risk that we will get
> bogus global value. 

My thought here is that the per-cpu counter could still be a 32-bit counter
and the global value could be a 64-bit value.  That way, we don't need to
mess with 64-bit math in the common case, and we can still have a 64-bit
global value.  The minor drawback would be that we can't have a per-cpu
delta of more than 2^31 at a time, but I don't think this is a worry here.

> > why not change the global per-cpu counter type to unsigned long (as we
> > discussed earlier), so we don't need the extra "ul" flags and interfaces, 
> > and all arches get a standard unsigned long return type? 
> >  We could also 
> > do away with percpu_read_positive then no?  The applications for per-cpu 
> > counters is going to be upcounters always methinks...

The "percpu_read_positive" usage is broken in any case, since it doesn't
correctly handle the case where there is no space in the filesystem at
all.  The calling code (ext3_statfs) really needs to just call percpu_read()
and then return zero if this is negative.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


  reply	other threads:[~2006-04-12 21:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-10 17:58 [RFC][PATCH 0/3] ext3 percpu counter fixes to suppport for ext3 unsigned long type free blocks counter Mingming Cao
2006-04-11 17:09 ` Christoph Lameter
2006-04-11 19:01   ` Mingming Cao
2006-04-11 22:20     ` Ravikiran G Thirumalai
2006-04-12 21:28       ` [Ext2-devel] " Mingming Cao
2006-04-12 21:50         ` Andreas Dilger [this message]
2006-04-13 19:02         ` Ravikiran G Thirumalai
2006-04-13 22:25           ` Mingming Cao
2006-04-14  0:20             ` Ravikiran G Thirumalai
2006-04-21 14:59 ` [PATCH 1/2] ext3 percpu counter fixes to suppport for more than 2**31 ext3 " Mingming Cao
2006-04-21 22:09   ` Andrew Morton
2006-04-24 17:48     ` Mingming Cao
2006-04-24 18:26       ` Ravikiran G Thirumalai
2006-04-24 19:13         ` Mingming Cao
2006-04-22  0:56   ` Ravikiran G Thirumalai
2006-04-24 17:49     ` Mingming Cao
2006-04-24 22:51   ` [RESEND][PATCH 1/2] percpu counter data type changes " Mingming Cao

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=20060412215027.GO17364@schatzie.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=Laurent.Vivier@bull.net \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=cmm@us.ibm.com \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=kiran@scalex86.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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).