Re: [PATCH][RFC] ext4: avoid taking down_read(&grp->alloc_sem)
From: Andreas Dilger <hidden>
Date: 2011-02-14 16:30:10
From: Andreas Dilger <hidden>
Date: 2011-02-14 16:30:10
On 2011-02-14, at 0:52, "Amir G." [off-list ref] wrote:
quoted
@@ -1160,7 +1160,15 @@ ext4_mb_load_buddy(struct super_block *sb, + /* + * We only need to take the read lock if other groups share the buddy + * page with this group or if blocks may be added to this (last) group + * by ext4_group_extend(). + */ + if (blocks_per_page > 2 || group == sbi->s_groups_count - 1) + e4b->alloc_semp = &grp->alloc_sem;
No comment on whether this change is safe or not, but shouldn't this check be:
if (blocks_per_page > 1 ||
Cheers, Andreas