Re: [PATCH] reiserfs: eliminate minimum window size for bitmap searching

From: Jeff Mahoney
Date: Tue Aug 22 2006 - 20:30:31 EST

Hash: SHA1

Andrew Morton wrote:
> I can see that the bigalloc code as-is is pretty sad, but this is a scary
> patch. It has the potential to cause people significant performance
> problems way, way ahead in the future.
> For example, suppose userspace is growing two files concurrently. It could
> be that the bigalloc code would cause one file's allocation cursor to
> repeatedly jump far away from the second. ie: a beneficial side-effect.
> Without bigalloc that side-effect is lost and the two files blocks end up
> all intermingled.
> I don't know if that scenario is realistic, but I bet there are similar
> accidental oddities which can occur as a result of this change.
> But what are they?

Bigalloc doesn't cause that effect one way or the other. You'll end up
with blocks still intermingled, just in 32 block[1] chunks. It doesn't
throw the cursor way out, just until the next 32 block free window.
Another thread writing will do the same thing, and the blocks can end up
getting intermingled in the same manner on a different part of the disk.

The behavior you're describing can only be caused by bad hinting: Two
files that are placed too close to each other. This patch changes the
part of the allocator that is *only* responsible for finding the free
bits. Where it should start looking for them is a decision made earlier
in determine_search_start().

This patch just reverts the change that Chris and I submitted ages ago
as part of a number of block allocator enhancements, not as a bug fix. I
think I traced it to the 2.5 days, but I can't find that particular
email. Neither of us anticipated the problem that MythTV users are
hitting with it. Reverting it just makes that part of the allocator
behave similarly to the ext[23] allocator where it just collects
available blocks from a starting point. For every day use, I don't think
performance should be terribly affected, and it definitely fixes the
pathological case that the MythTV users were seeing.

- -Jeff

[1]: For simplicity, I'll continue to reference 32 blocks as the chunk
size. In reality, it can be anything up to 32 blocks.

- --
Jeff Mahoney
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE -

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at