Re: [PATCH][RFC] ext4: avoid taking down_read(&grp->alloc_sem)
From: Amir G. <hidden>
Date: 2011-02-14 18:18:13
On Mon, Feb 14, 2011 at 6:30 PM, Andreas Dilger [off-list ref] wrote:
On 2011-02-14, at 0:52, "Amir G." [off-list ref] wrote:quoted
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 ||
No, it should be groups_per_page > 1, as Aneesh suggested, which translates to blocks_per_group > 2, but this is obviously not clear from the code... -- 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