diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-20 17:41:05 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-21 22:04:25 +0000 |
commit | 468fa9a7fac86bb0fcd3cbd18dc1492b57ca25f3 (patch) | |
tree | f26d446f8d1dd9e383bb4d349429b85e4c2aab72 /meta | |
parent | fd7f3cd9affbfb9ce483a5a1d6054da2365fcb0e (diff) | |
download | openembedded-core-468fa9a7fac86bb0fcd3cbd18dc1492b57ca25f3.tar.gz openembedded-core-468fa9a7fac86bb0fcd3cbd18dc1492b57ca25f3.tar.bz2 openembedded-core-468fa9a7fac86bb0fcd3cbd18dc1492b57ca25f3.zip |
e2fsprogs: Add a patch to speedup mkfs
See the patch description, this adds a tweak to an algorithm to improve
core-image-sato-sdk mkfs time from over 8 minutes to about 35s.
Needs discussion upstream but seems reasonable for our uses of it.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch | 52 | ||||
-rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch new file mode 100644 index 0000000000..f9ef8e5f26 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch @@ -0,0 +1,52 @@ +The comment to this function says: + +""" + * Stupid algorithm --- we now just search forward starting from the + * goal. Should put in a smarter one someday.... +""" + +This adds in a rather hacky algorthim which starts where we finished +searching previously using a static variable rather than starting +from scratch if a hint isn't provided. + +This was after noticing that mkfs.ext4 -F X -d Y was spending *lots* +of time in ext2fs_new_block2 called from ext2fs_bmap from ext2fs_file_write(). + +Numbers wise, this took a core-image-sato-sdk mkfs time from over +8 minutes to around 35 seconds. + +Upstream-Status: Pending + +RP 2015/02/20 + +Index: e2fsprogs-1.42.9/lib/ext2fs/alloc.c +=================================================================== +--- e2fsprogs-1.42.9.orig/lib/ext2fs/alloc.c ++++ e2fsprogs-1.42.9/lib/ext2fs/alloc.c +@@ -160,6 +160,8 @@ errcode_t ext2fs_new_inode(ext2_filsys f + return 0; + } + ++static blk64_t last_goal = 0; ++ + /* + * Stupid algorithm --- we now just search forward starting from the + * goal. Should put in a smarter one someday.... +@@ -170,6 +172,9 @@ errcode_t ext2fs_new_block2(ext2_filsys + blk64_t i; + int c_ratio; + ++ if (!goal) ++ goal = last_goal; ++ + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); + + if (!map) +@@ -194,6 +199,7 @@ errcode_t ext2fs_new_block2(ext2_filsys + + if (!ext2fs_fast_test_block_bitmap2(map, i)) { + *ret = i; ++ last_goal = i; + return 0; + } + i = (i + c_ratio) & ~(c_ratio - 1); diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb index f1fb3a700c..656793f9ab 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb @@ -19,6 +19,7 @@ SRC_URI += "file://acinclude.m4 \ file://0012-Fix-musl-build-failures.patch \ file://0001-e2fsprogs-fix-cross-compilation-problem.patch \ file://misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch \ + file://cache_inode.patch \ " SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7" |