Message ID | 20081123163349.GB17002@skywalker |
---|---|
State | Accepted, archived |
Headers | show |
On Sun, Nov 23, 2008 at 10:03:49PM +0530, Aneesh Kumar K.V wrote: > > How about the below patch. We can have more than 2 groups in a page > depending on the page size and blocksize. So instead of using > single_depth I guess we should use the relative group number ?. That should work. The maximum number of subclasses that we can have by default is 8. With 16k pages, that will barely be enough for 1k blocksize file systems (since we lock alloc_sem for page_size/(2*fs_block_size) block groups). If we need more than that, we might be better off just locking the entire filesystem against block allocations, since after all this is a pretty rare case; it's used only when we resize or when the filesystem is getting mounted. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
I've added your patch to the patch queue, using the following commit
comment, and using it to replace
aneesh-9-fix-lockdeep-recursive-locking-warning in the patch queue.
Please note that commit description explains what was the problem you
were trying to solve, some notes about why this works, what the
limitations might be with the approach. This is the kind of commit
logs we should strive for. We've been complemented for the clarity of
our commit logs, and much of that is because I've been rewriting the
changelog messages. If everyone who submits patches could strive to
meet similar standards, I'd greatly appreciated.
- Ted
ext4: Fix lockdep recursive locking warning
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
In ext4_mb_init_group(), if the filesystem block size is less than
PAGE_SIZE/2, the code tries to grab alloc_sem for multiple block
groups in a loop. We need to allow for this by using
down_write_nested() and passing in the loop index as a lock subclass
number. This works because no other code path needs to take multiple
alloc_sem's. Note that lockdep will fail for filesystem blocksize
smaller than to PAGE_SIZE/16k. (e.g., a 1k filesystem blocksize with
a 32k page size, or a 2k filesystem blocksize with a 64k blocksize,
etc.)
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 1fa311c..891ce41 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1783,7 +1783,7 @@ static int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) * no block allocation going on in any * of that groups */ - down_write(&grp->alloc_sem); + down_write_nested(&grp->alloc_sem, i); } /* * make sure we look at only those groups