[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100407144603.GO23670@thunk.org>
Date: Wed, 7 Apr 2010 10:46:03 -0400
From: tytso@....edu
To: jing zhang <zj.barak@...il.com>
Cc: Andreas Dilger <adilger@....com>,
linux-ext4 <linux-ext4@...r.kernel.org>,
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()
On Wed, Apr 07, 2010 at 08:58:36PM +0800, jing zhang wrote:
> 2010/4/7, tytso@....edu <tytso@....edu>:
> > On Thu, Apr 01, 2010 at 08:34:41PM +0800, jing zhang wrote:
> >>
> >> --- linux-2.6.32/fs/ext4/mballoc.c 2009-12-03 11:51:22.000000000 +0800
> >> +++ ext4_mm_leak/mballoc-14.c 2010-04-01 20:35:58.000000000 +0800
> >> @@ -4299,7 +4299,7 @@ repeat:
> >> }
> >> } else {
> >> freed = ext4_mb_discard_preallocations(sb, ac->ac_o_ex.fe_len);
> >> - if (freed)
> >> + if (freed && freed >= ac->ac_o_ex.fe_len)
> >> goto repeat;
> >> *errp = -ENOSPC;
> >> ac->ac_b_ex.fe_len = 0;
> >
> > This is just wrong.
> >
> > Since you didn't give a justification, I'm not sure why you think it
> > is correct.
> >
>
> Though freed, is the amount freed bigger than needed?
> If not, it seems unnecessary to repeat.
You don't understand the code, I think. If we've freed up any number
of blocks, it makes sense to use those blocks right away. Mballoc()
is allowed to return fewer blocks than what was requested.
- 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