linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jing zhang <zj.barak@gmail.com>
To: Andreas Dilger <adilger@sun.com>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
	"Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH] ext4: group cache is added in ext4_mb_discard_preallocations()
Date: Thu, 1 Apr 2010 20:34:41 +0800	[thread overview]
Message-ID: <h2zac8f92701004010534g3607d64fh2dcf615053e59549@mail.gmail.com> (raw)
In-Reply-To: <56E2631B-9D71-4B96-9F2C-D469F6994598@sun.com>

2010/3/31, Andreas Dilger <adilger@sun.com>:
> On 2010-03-30, at 06:36, 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
>> 	trace_ext4_mb_discard_preallocations(sb, needed);
>> -	for (i = 0; i < ngroups && needed > 0; i++) {
>> -		ret = ext4_mb_discard_group_preallocations(sb, i, needed);
>> +	if (needed <= 0)
>> +		return freed;
>> +	for (i = 0; i < ngroups; i++) {
>> +		if (grp_cache >= ngroups)
>> +			grp_cache -= ngroups;
>> +		ret = ext4_mb_discard_group_preallocations(sb, grp_cache, needed);
>
>
> Anything that is walking every group in the filesystem is going to hit
> problems on large filesystems.  This seems like something that needs
> to be fixed in a different way (e.g. keeping a list of preallocations).
>
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Staff Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.
>
>

Then please take the following also into consideration.

Thanks
            - zj

---

--- 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;

  reply	other threads:[~2010-04-01 12:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 12:36 [PATCH] ext4: group cache is added in ext4_mb_discard_preallocations() jing zhang
2010-03-30 18:37 ` Aneesh Kumar K. V
2010-03-31 15:10   ` jing zhang
2010-03-31 15:03 ` Andreas Dilger
2010-04-01 12:34   ` jing zhang [this message]
2010-04-06 18:49     ` tytso
2010-04-07 12:58       ` jing zhang
2010-04-07 14:46         ` tytso
2010-04-06 18:31 ` tytso
2010-04-07 12:50   ` jing zhang

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=h2zac8f92701004010534g3607d64fh2dcf615053e59549@mail.gmail.com \
    --to=zj.barak@gmail.com \
    --cc=adilger@sun.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=tytso@mit.edu \
    /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).