On Tue, Nov 04, 2008 at 01:00:44PM -0500, Theodore Tso wrote: > On Mon, Nov 03, 2008 at 11:06:03PM +0530, Aneesh Kumar K.V wrote: > > The new groups added during resize are flagged as > > need_init group. Make sure we properly initialize these > > groups. When we have block size < page size and we are adding > > new groups the page may still be marked uptodate even though > > we haven't initialized the group. > > Aneesh, can you explain to me again why we can't just call > ext4_mb_free_blocks(). I thought I heard you say that the buddy > bitmaps weren't appropriately initialized for the end of the bitmap > --- but I just went through mballoc.c and I couldn't see the problem. > What am I missing? > We should be able to use ext4_mb_free_blocks() during resize provided we fix mb_load_buddy to handle the new block group added. Frederic's patch actually did that. The problem is with blocksize less than page size, we need to be more careful when looking at the uptodate flag of the page because the new block group added can have its bitmap as a part of already used/uptodate page. So in short we would need some flags to indicate that that even though the page is marked as uptodate we would like to force init the buddy cache(ie, call ext4_mb_init_cache). Which in turn would require us to make sure no parallel load_buddy is happening.(currently ensured by alloc_sem in the patch series). This is because we are doing a reinit of the page. I actually tried to do it that way first. But found the code to more confusing with all the locking. -aneesh -- 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