From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Laurent Vivier <Laurent.Vivier@bull.net>,
Andrew Morton <akpm@osdl.org>, Takashi Sato <sho@tnes.nec.co.jp>,
Badari Pulavarty <pbadari@us.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [Ext2-devel] [PATCH 2/2] ext2/3: Support2^32-1blocks(e2fsprogs)
Date: Wed, 29 Mar 2006 12:00:20 -0800 [thread overview]
Message-ID: <20060329200020.GA3729@localhost.localdomain> (raw)
In-Reply-To: <1143657317.4045.12.camel@dyn9047017067.beaverton.ibm.com>
On Wed, Mar 29, 2006 at 10:35:10AM -0800, Mingming Cao wrote:
> On Wed, 2006-03-29 at 11:13 +0200, Laurent Vivier wrote:
> >
> > You're right, Mingming.
> >
> > But I think instead of thinking to change "long" by "long long" we
> > should think about changing "long" by "unsigned long" in the per-cpu
> > counter structure.
> >
> > Is there someone knowing why this counter is signed ?
>
> I am wondering the same thing asked by Laurent. Initially I thought the
> signed value is there to prevent overflow, or to maintain a "int" type
> counters. Are those the intentions, kiran?
I don't know if the local counter version values can be unsigned in this
case. Consider a case like this with the initial counter value to be 0,
and FBC_BATCH is 32 (8cpusx4)
cpu 1 cpu 2 cpu 3
-------- ------- --------
add(10)
//local = 10 fbc = 0.
sub(5)
//local = -5 fbc = 0
add(31)
//local = 31 fbc = 0
sub(30)
//local = 0 fbc = -35
--------------->(A)
Now if the local counters were unsigned, and the global counters unsigned
too, counter read at A would result in a large value, which would mislead
the app. Maybe it doesn't matter if we use percpu_counter_exceeds at
critical places, so these get caught, but that would mean going on all cpus
more often than before..and that would also mean weird values when we just
use percpu_counter_read to print these counters.
So maybe using long long is a simpler solution here? Andrew, thoughts?
>
> But it seems the per cpu counters used in ext2/3 are all number of free
> blocks/inodes/directories. So it should be always positive values. It
> seems fine to change the percpu counters to type "unsigned long" for
> ext2/3 itself. But I am not sure if this will cause issues for other
> users of percpu counters. Kiran, could you please confirm this?
I guess most of the uses for per-cpu counters will be up counters, we don't
need the signedness if it wasn't for the issues above. The nr_files,
memory_allocated counters are up counters too.
Thanks,
Kiran
next prev parent reply other threads:[~2006-03-29 19:59 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-25 13:33 [Ext2-devel] [PATCH 2/2] ext2/3: Support2^32-1blocks(e2fsprogs) sho
2006-03-26 22:37 ` Badari Pulavarty
2006-03-27 4:17 ` Takashi Sato
2006-03-27 18:45 ` Mingming Cao
2006-03-27 21:10 ` Andrew Morton
2006-03-27 22:58 ` Ravikiran G Thirumalai
2006-03-28 7:15 ` Laurent Vivier
2006-03-28 8:02 ` Ravikiran G Thirumalai
2006-03-28 10:34 ` Laurent Vivier
2006-03-28 18:01 ` Mingming Cao
2006-03-29 9:13 ` Laurent Vivier
[not found] ` <1143657317.4045.12.camel@dyn9047017067.beaverton.ibm.com>
2006-03-29 20:00 ` Ravikiran G Thirumalai [this message]
2006-03-29 20:38 ` Mingming Cao
2006-03-30 8:41 ` Ravikiran G Thirumalai
2006-03-30 1:38 ` [RFC][PATCH 0/2]Extend ext3 filesystem limit from 8TB to 16TB Mingming Cao
2006-03-30 1:54 ` Andrew Morton
2006-03-31 22:42 ` Mingming Cao
2006-04-02 20:13 ` Mingming Cao
2006-04-10 9:11 ` [Ext2-devel] " Laurent Vivier
2006-04-10 8:24 ` Andrew Morton
2006-04-13 15:26 ` Laurent Vivier
2006-04-17 21:07 ` Ravikiran G Thirumalai
2006-04-17 21:09 ` Arjan van de Ven
2006-04-17 21:32 ` Ravikiran G Thirumalai
2006-04-18 7:14 ` Laurent Vivier
2006-04-18 7:30 ` Arjan van de Ven
2006-04-18 10:57 ` Laurent Vivier
2006-04-18 19:08 ` Ravikiran G Thirumalai
2006-04-18 14:09 ` Laurent Vivier
2006-04-18 21:01 ` Mingming Cao
2006-04-20 11:28 ` Laurent Vivier
[not found] ` <1145543970.5872.38.camel@openx2.frec.bull.fr>
2006-04-21 11:17 ` Laurent Vivier
2006-04-10 16:57 ` Mingming Cao
2006-04-10 19:06 ` Mingming Cao
2006-04-11 7:07 ` Laurent Vivier
2006-04-14 17:23 ` Ravikiran G Thirumalai
2006-03-30 17:36 ` Andreas Dilger
2006-03-30 19:01 ` Mingming Cao
2006-03-30 17:40 ` Andreas Dilger
2006-03-30 19:16 ` Mingming Cao
2006-03-30 19:22 ` Mingming Cao
2006-03-31 6:42 ` Andreas Dilger
2006-03-31 13:33 ` Andi Kleen
2006-04-01 6:50 ` Nathan Scott
2006-05-26 5:00 ` [PATCH 0/2]Define ext3 in-kernel filesystem block types and extend " Mingming Cao
2006-05-26 18:08 ` Andrew Morton
2006-05-30 17:55 ` Mingming Cao
2006-03-30 1:39 ` [RFC][PATCH 1/2]ext3 block allocation/reservation fixes to support 2**32 block numbers Mingming Cao
2006-03-30 1:39 ` [RFC][PATCH 2/2]Other ext3 in-kernel block number type fix " Mingming Cao
-- strict thread matches above, loose matches on Subject: below --
2006-03-25 13:34 [Ext2-devel] [PATCH 2/2] ext2/3: Support2^32-1blocks(e2fsprogs) sho
2006-03-15 12:39 [PATCH 2/2] ext2/3: Support 2^32-1 blocks(e2fsprogs) Takashi Sato
2006-03-17 21:19 ` [Ext2-devel] " Badari Pulavarty
2006-03-18 5:57 ` [Ext2-devel] [PATCH 2/2] ext2/3: Support 2^32-1blocks(e2fsprogs) Takashi Sato
2006-03-22 23:45 ` Badari Pulavarty
2006-03-23 18:16 ` Badari Pulavarty
2006-03-24 1:54 ` [Ext2-devel] [PATCH 2/2] ext2/3: Support2^32-1blocks(e2fsprogs) Takashi Sato
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=20060329200020.GA3729@localhost.localdomain \
--to=kiran@scalex86.org \
--cc=Laurent.Vivier@bull.net \
--cc=akpm@osdl.org \
--cc=cmm@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbadari@us.ibm.com \
--cc=sho@tnes.nec.co.jp \
/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