On Thu, Aug 20, 2009 at 12:52:38PM +0530, Aneesh Kumar K.V wrote: > > This would give bad allocation pattern for large files. We should be > using global goal only for small files not for large files. Huh? Small files should be allocated within their flex_bg close to their parent directories, right? Large files are supposed to allocated globally, potentially outside of the flex_bg so they won't chew up all of the space in the local flex_bg. Also, the comments ext4.h for s_mb_last_group and s_mb_last_start indicate: "where last allocation was done - for stream allocation". If your interpretation was correct, the comment would be wrong. > Large files should be using neighbour allocated extent block as the > goal, so that we get contiguous blocks. We do use the neighbour allocated extent block as the goal. The code in question here is used only when the ext4_mb_find_by_goal() has failed. This brings up the larger problem which is the mballoc code is extremely hard to understand, and not sufficiently documented, where the algorithm is broken up so many pieces that unless you spend a long time mind-melding with the code, it's sometimes very hard to get a mental map of the forest versus the trees. - Ted -- 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