From: Mingming Cao <cmm@us.ibm.com>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: Andrew Morton <akpm@osdl.org>,
kiran@scalex86.org, Laurent.Vivier@bull.net,
linux-kernel@vger.kernel.org, ext2-devel@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH 1/3] per cpu counter fixes for unsigned long type counter overflow
Date: Tue, 11 Apr 2006 10:23:41 -0700 [thread overview]
Message-ID: <1144776221.3986.0.camel@dyn9047017067.beaverton.ibm.com> (raw)
In-Reply-To: <20060411075440.GQ17364@schatzie.adilger.int>
On Tue, 2006-04-11 at 01:54 -0600, Andreas Dilger wrote:
> On Apr 10, 2006 18:09 -0700, Mingming Cao wrote:
> > +static void __percpu_counter_mod(struct percpu_counter *fbc, long amount,
> > + int ul_overflow_check)
> > {
> > + * Before updating the global counter, if we detect the
> > + * updated new value will cause overflow, then we should not
> > + * do the update from this local counter at this moment. (i.e.
> > + * the local counter will not be cleared right now). The update
> > + * will be deferred at some point until either other local
> > + * counter updated the global counter first, or the local
> > + * counter's value will not cause global counter overflow.
>
> Wouldn't it be better to update the counter by the maximum amount possible
> to avoid overflow/underflow?
>
Yep. Thanks for pointing this out.:)
Mingming
> Cheers, Andreas
> --
> Andreas Dilger
> Principal Software Engineer
> Cluster File Systems, Inc.
>
next prev parent reply other threads:[~2006-04-11 17:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-10 17:59 [RFC][PATCH 1/3] per cpu counter fixes for unsigned long type counter overflow Mingming Cao
2006-04-10 22:18 ` Andrew Morton
2006-04-11 1:09 ` Mingming Cao
2006-04-11 7:54 ` Andreas Dilger
2006-04-11 17:23 ` Mingming Cao [this message]
2006-04-21 14:59 ` [PATCH 2/2] ext3 free blocks counter initialization fix Mingming Cao
2006-04-24 22:51 ` [PATCH 2/2] Set initial value when calling percpu counter initialization routine 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=1144776221.3986.0.camel@dyn9047017067.beaverton.ibm.com \
--to=cmm@us.ibm.com \
--cc=Laurent.Vivier@bull.net \
--cc=adilger@clusterfs.com \
--cc=akpm@osdl.org \
--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).