All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: cmm@us.ibm.com, sandeen@redhat.com, linux-ext4@vger.kernel.org
Subject: Re: [RFC PATCH -v2 7/9] ext4: don't use the block freed but not yet committed during buddy initialization
Date: Tue, 4 Nov 2008 12:15:15 -0500	[thread overview]
Message-ID: <20081104171515.GL30291@mit.edu> (raw)
In-Reply-To: <1225733769-23734-7-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Mon, Nov 03, 2008 at 11:06:07PM +0530, Aneesh Kumar K.V wrote:
> +static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap,
> +					ext4_group_t group,
> +					struct ext4_free_data *entry)
> +{
	...
> +	if (n->rb_left) {
> +		new_entry = rb_entry(n->rb_left, struct ext4_free_data, node);
> +		ext4_mb_generate_from_freelist(sb, bitmap, group, new_entry);
> +	}
> +	if (n->rb_right) {
> +		new_entry = rb_entry(n->rb_right, struct ext4_free_data, node);
> +		ext4_mb_generate_from_freelist(sb, bitmap, group, new_entry);
> +	}

ext4_mb_generate_from_freelist() is recursively calling itself, which
could easily blow the stack if there are a large number of items on
the free list (remember, this can include data blocks if
!ext4_should_writeback_data()).

You should probably use rb_first and rb_next in a loop rather than a
recursive descent.  I also remain concerned that
ext4_mb_generate_from_freelist() is could burn a large amount of CPU
in some cases, and as I said on the conference call, if there is a way
to avoid it, that would be a Good Thing.

						- Ted

  parent reply	other threads:[~2008-11-04 17:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03 17:36 [RFC PATCH -v2 1/9] ext4: sparse fixes Aneesh Kumar K.V
2008-11-03 17:36 ` [RFC PATCH -v2 2/9] ext4: Add blocks added during resize to bitmap Aneesh Kumar K.V
2008-11-03 17:36   ` [RFC PATCH -v2 3/9] ext4: Use EXT4_GROUP_INFO_NEED_INIT_BIT during resize Aneesh Kumar K.V
2008-11-03 17:36     ` [RFC PATCH -v2 4/9] ext4: cleanup mballoc header files Aneesh Kumar K.V
2008-11-03 17:36       ` [RFC PATCH -v2 5/9] ext4: sparse annotate the group info semaphore Aneesh Kumar K.V
2008-11-03 17:36         ` [RFC PATCH -v2 6/9] ext4: Call journal commit callback without holding j_list_lock Aneesh Kumar K.V
2008-11-03 17:36           ` [RFC PATCH -v2 7/9] ext4: don't use the block freed but not yet committed during buddy initialization Aneesh Kumar K.V
2008-11-03 17:36             ` [RFC PATCH -v2 8/9] ext4: Fix double free of blocks Aneesh Kumar K.V
2008-11-03 17:36               ` [RFC PATCH -v2 9/9] ext4: Fix lockdep recursive locking warning Aneesh Kumar K.V
2008-11-04 18:15                 ` Theodore Tso
2008-11-04 16:46               ` [RFC PATCH -v2 8/9] ext4: Fix double free of blocks Theodore Tso
2008-11-05 15:25                 ` Aneesh Kumar K.V
2008-11-04 17:15             ` Theodore Tso [this message]
2008-11-05 15:23               ` [RFC PATCH -v2 7/9] ext4: don't use the block freed but not yet committed during buddy initialization Aneesh Kumar K.V
2008-11-04 17:37           ` [RFC PATCH -v2 6/9] ext4: Call journal commit callback without holding j_list_lock Theodore Tso
2008-11-04 18:13           ` Theodore Tso
2008-11-04 17:43         ` [RFC PATCH -v2 5/9] ext4: sparse annotate the group info semaphore Theodore Tso
2008-11-05 14:59           ` Aneesh Kumar K.V
2008-11-04 18:00     ` [RFC PATCH -v2 3/9] ext4: Use EXT4_GROUP_INFO_NEED_INIT_BIT during resize Theodore Tso
2008-11-05 14:57       ` Aneesh Kumar K.V
2008-11-04 18:02 ` [RFC PATCH -v2 1/9] ext4: sparse fixes Theodore Tso

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=20081104171515.GL30291@mit.edu \
    --to=tytso@mit.edu \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.