public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes
@ 2008-08-15 22:01 Eric Sandeen
  2008-08-16 15:25 ` Theodore Tso
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2008-08-15 22:01 UTC (permalink / raw)
  To: ext4 development; +Cc: Jose R. Santos

I've got a case where I have a 99G fs with 17G free, as well
as 400k free inodes, and yet I cannot create a new inode.

The find_group_flex() function starts with best_flex as
the parent_fbg_group, which happens to have 0 inodes free.

Some of the flex groups searched have free blocks and free 
inodes, but the flex_freeb_ratio is < 10, so they're skipped.

Then when a group is compared to the current "best" flex group,
it does not have more free blocks than "best", so it is skipped
as well.

This continues until no flex group with free inodes is found
which has a proper ratio or which has more free blocks than
the "best" group, and we're left with a "best" group that has
0 inodes free, and we return -ENOSPC.

It seems like adjusting the following test is a better plan;
for starters I do not see that best_flex can ever be < 0, so
that test is replaced, and if the current "best" flex group
has no inodes free, and the current one does have room,
it is promoted to the next "best."

Comments?

Signed-of-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6/fs/ext4/ialloc.c
===================================================================
--- linux-2.6.orig/fs/ext4/ialloc.c	2008-08-04 15:30:30.000000000 -0500
+++ linux-2.6/fs/ext4/ialloc.c	2008-08-15 16:12:47.366515679 -0500
@@ -351,7 +351,7 @@ find_close_to_parent:
 			goto found_flexbg;
 		}
 
-		if (best_flex < 0 ||
+		if (flex_group[best_flex].free_inodes == 0 ||
 		    (flex_group[i].free_blocks >
 		     flex_group[best_flex].free_blocks &&
 		     flex_group[i].free_inodes))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes
  2008-08-15 22:01 [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes Eric Sandeen
@ 2008-08-16 15:25 ` Theodore Tso
  2008-08-16 17:35   ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Tso @ 2008-08-16 15:25 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, Jose R. Santos

On Fri, Aug 15, 2008 at 05:01:10PM -0500, Eric Sandeen wrote:
> It seems like adjusting the following test is a better plan;
> for starters I do not see that best_flex can ever be < 0, so

Given that ext4_group_t is an unsigned long, that's certainly true.
:-)

> that test is replaced, and if the current "best" flex group
> has no inodes free, and the current one does have room,
> it is promoted to the next "best."

Looks good to me.  I've added it to the patch queue.

> Signed-of-by: Eric Sandeen <sandeen@redhat.com>

(forgot an 'f' :-)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes
  2008-08-16 15:25 ` Theodore Tso
@ 2008-08-16 17:35   ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2008-08-16 17:35 UTC (permalink / raw)
  To: Theodore Tso; +Cc: ext4 development, Jose R. Santos

Theodore Tso wrote:
> On Fri, Aug 15, 2008 at 05:01:10PM -0500, Eric Sandeen wrote:
>> It seems like adjusting the following test is a better plan;
>> for starters I do not see that best_flex can ever be < 0, so
> 
> Given that ext4_group_t is an unsigned long, that's certainly true.
> :-)

Heh, that too!

>> that test is replaced, and if the current "best" flex group
>> has no inodes free, and the current one does have room,
>> it is promoted to the next "best."
> 
> Looks good to me.  I've added it to the patch queue.
> 
>> Signed-of-by: Eric Sandeen <sandeen@redhat.com>
> 
> (forgot an 'f' :-)

Urk...

Thanks!

-Eric

> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> 
> 					- Ted


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-16 18:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-15 22:01 [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes Eric Sandeen
2008-08-16 15:25 ` Theodore Tso
2008-08-16 17:35   ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox