[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2yac8f92701004070550zc4b459d3pb33b9d7f5bd875e9@mail.gmail.com>
Date: Wed, 7 Apr 2010 20:50:52 +0800
From: jing zhang <zj.barak@...il.com>
To: tytso@....edu
Cc: linux-ext4 <linux-ext4@...r.kernel.org>,
Andreas Dilger <adilger@....com>,
Dave Kleikamp <shaggy@...ux.vnet.ibm.com>,
"Aneesh Kumar K. V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: Re: [PATCH] ext4: group cache is added in ext4_mb_discard_preallocations()
2010/4/7, tytso@....edu <tytso@....edu>:
> On Tue, Mar 30, 2010 at 08:36:17PM +0800, jing zhang wrote:
>> --- linux-2.6.32/fs/ext4/mballoc.c 2009-12-03 11:51:22.000000000 +0800
>> +++ ext4_mm_leak/mballoc-13.c 2010-03-30 20:28:08.000000000 +0800
>> @@ -4183,12 +4183,20 @@ static int ext4_mb_discard_preallocation
>> ext4_group_t i, ngroups = ext4_get_groups_count(sb);
>> int ret;
>> int freed = 0;
>> + static ext4_group_t grp_cache = 0;
>
> This is a problem right there. Remember that there could be multiple
> file systems mounted so a static variable is fundamentally flawed.
>
cool, the static in my patch is a fatal error.
- zj
> In fact, we could have a one filesystem which has more than 3 times
> the number of groups as another file system. I'll leave it as an
> exercise to a reader why your patch would be fundamentally flawed in
> that case.
>
> The other thing to note is that this case only gets hit if the file
> system is so full that we need to empty preallocations. So this means
> hitting this case is rare, which raises two questions: (1) is it worth
> it to optimize this case in the first place (is it really that
> expensive to iterate over all the groups to discard the
> preallocations); (2) can we test this case well?
>
> - Ted
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists