diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-20 17:41:05 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-17 22:39:30 +0100 |
commit | 9c2e4e50a8cf48d6a0948f33559b5ecaeaf655c8 (patch) | |
tree | 8e1acf6b4e1b084291c0e84c652a1ac510b900d2 /meta/recipes-devtools | |
parent | e8a260c9b8c3f63253da18a44a41146069fd05bd (diff) | |
download | poky-9c2e4e50a8cf48d6a0948f33559b5ecaeaf655c8.tar.gz |
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.
(From OE-Core rev: 468fa9a7fac86bb0fcd3cbd18dc1492b57ca25f3)
(From OE-Core rev: 5aee64c9577affc35ad1555f2a7eb9d287b9fda4)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-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 @@ | |||
1 | The comment to this function says: | ||
2 | |||
3 | """ | ||
4 | * Stupid algorithm --- we now just search forward starting from the | ||
5 | * goal. Should put in a smarter one someday.... | ||
6 | """ | ||
7 | |||
8 | This adds in a rather hacky algorthim which starts where we finished | ||
9 | searching previously using a static variable rather than starting | ||
10 | from scratch if a hint isn't provided. | ||
11 | |||
12 | This was after noticing that mkfs.ext4 -F X -d Y was spending *lots* | ||
13 | of time in ext2fs_new_block2 called from ext2fs_bmap from ext2fs_file_write(). | ||
14 | |||
15 | Numbers wise, this took a core-image-sato-sdk mkfs time from over | ||
16 | 8 minutes to around 35 seconds. | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | RP 2015/02/20 | ||
21 | |||
22 | Index: e2fsprogs-1.42.9/lib/ext2fs/alloc.c | ||
23 | =================================================================== | ||
24 | --- e2fsprogs-1.42.9.orig/lib/ext2fs/alloc.c | ||
25 | +++ e2fsprogs-1.42.9/lib/ext2fs/alloc.c | ||
26 | @@ -160,6 +160,8 @@ errcode_t ext2fs_new_inode(ext2_filsys f | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | +static blk64_t last_goal = 0; | ||
31 | + | ||
32 | /* | ||
33 | * Stupid algorithm --- we now just search forward starting from the | ||
34 | * goal. Should put in a smarter one someday.... | ||
35 | @@ -170,6 +172,9 @@ errcode_t ext2fs_new_block2(ext2_filsys | ||
36 | blk64_t i; | ||
37 | int c_ratio; | ||
38 | |||
39 | + if (!goal) | ||
40 | + goal = last_goal; | ||
41 | + | ||
42 | EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); | ||
43 | |||
44 | if (!map) | ||
45 | @@ -194,6 +199,7 @@ errcode_t ext2fs_new_block2(ext2_filsys | ||
46 | |||
47 | if (!ext2fs_fast_test_block_bitmap2(map, i)) { | ||
48 | *ret = i; | ||
49 | + last_goal = i; | ||
50 | return 0; | ||
51 | } | ||
52 | 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 1fb4a6cd85..2dd3d547df 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 \ | |||
19 | file://0012-Fix-musl-build-failures.patch \ | 19 | file://0012-Fix-musl-build-failures.patch \ |
20 | file://0001-e2fsprogs-fix-cross-compilation-problem.patch \ | 20 | file://0001-e2fsprogs-fix-cross-compilation-problem.patch \ |
21 | file://misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch \ | 21 | file://misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch \ |
22 | file://cache_inode.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7" | 25 | SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7" |