On Tue, Jul 22, 2008 at 04:40:16PM +0530, Aneesh Kumar K.V wrote: > Currently locality group prealloc list is freed only when there is a block allocation > failure. This can result in large number of per cpu locality group prealloc space > and also make the ext4_mb_use_preallocated expensive. Convert the locality group > prealloc list to a hash list. The hash index is the order of number of blocks > in the prealloc space with a max order of 9. When adding prealloc space to the > list we make sure total entries for each order does not exceed 8. If it is more > than 8 we discard few entries and make sure the we have only <= 5 entries. > > small update to fix the wrong usage of list APIs diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index e058509..f8da1a2 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3348,7 +3348,7 @@ static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac, if (!added && pa->pa_free < tmp_pa->pa_free) { /* Add to the tail of the previous entry */ list_add_tail_rcu(&pa->pa_inode_list, - tmp_pa->pa_inode_list.prev); + &tmp_pa->pa_inode_list); added = 1; /* we want to count the total * number of entries in the list @@ -3357,7 +3357,7 @@ static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac, lg_prealloc_count++; } if (!added) - list_add_tail_rcu(&pa->pa_inode_list, &tmp_pa->pa_inode_list); + list_add_tail_rcu(&pa->pa_inode_list, &lg->lg_prealloc_list[order]); /* Now trim the list to be not more than 8 elements */ if (lg_prealloc_count > 8) { -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html