From cb63c4372359db81d95b864ce569870ce72afeb3 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 15 Jun 2015 00:36:32 -0400 Subject: [PATCH] add patch mballoc-avoid-20-argument-function-call --- mballoc-avoid-20-argument-function-call | 34 +++++++++++++++++++++++++++++++++ series | 1 + timestamps | 9 +++++---- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 mballoc-avoid-20-argument-function-call diff --git a/mballoc-avoid-20-argument-function-call b/mballoc-avoid-20-argument-function-call new file mode 100644 index 00000000..515bf8c3 --- /dev/null +++ b/mballoc-avoid-20-argument-function-call @@ -0,0 +1,34 @@ +ext4: mballoc: avoid 20-argument function call + +From: Rasmus Villemoes + +Making a function call with 20 arguments is rather expensive in both +stack and .text. In this case, doing the formatting manually doesn't +make it any less readable, so we might as well save 155 bytes of .text +and 112 bytes of stack. + +Signed-off-by: Rasmus Villemoes +--- + fs/ext4/mballoc.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c +index 8d1e60214ef0..a74bbbd6d57d 100644 +--- a/fs/ext4/mballoc.c ++++ b/fs/ext4/mballoc.c +@@ -2257,12 +2257,9 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) + + group--; + if (group == 0) +- seq_printf(seq, "#%-5s: %-5s %-5s %-5s " +- "[ %-5s %-5s %-5s %-5s %-5s %-5s %-5s " +- "%-5s %-5s %-5s %-5s %-5s %-5s %-5s ]\n", +- "group", "free", "frags", "first", +- "2^0", "2^1", "2^2", "2^3", "2^4", "2^5", "2^6", +- "2^7", "2^8", "2^9", "2^10", "2^11", "2^12", "2^13"); ++ seq_puts(seq, "#group: free frags first [" ++ " 2^0 2^1 2^2 2^3 2^4 2^5 2^6 " ++ " 2^7 2^8 2^9 2^10 2^11 2^12 2^13 ]"); + + i = (sb->s_blocksize_bits + 2) * sizeof(sg.info.bb_counters[0]) + + sizeof(struct ext4_group_info); diff --git a/series b/series index 3f9dd042..328892bc 100644 --- a/series +++ b/series @@ -50,6 +50,7 @@ use-swap-in-mext_page_double_lock use_GFP_NOFS_in_jbd2_cleanup_journal_tail recalculate-journal-credits-as-inode-depth-changes wait-for-existing-dio-workers-in-ext4_alloc_file_blocks +mballoc-avoid-20-argument-function-call ########################################## # unstable patches diff --git a/timestamps b/timestamps index 49188ab3..d3eea8e9 100755 --- a/timestamps +++ b/timestamps @@ -56,7 +56,6 @@ touch -d @1433829903 dump-in-use-buffers touch -d @1433829963 akpm-jbd2-locking-fix touch -d @1434167073 crypto-check-blocksize-eq-pagesize touch -d @1434332382 fix-race-between-truncate-and-ext4_journalled_writepage -touch -d @1434332442 stable-boundary touch -d @1434332502 stable-boundary-undo.patch touch -d @1434332562 add-fallocate-mode-blocking-for-debugging touch -d @1434332622 add-blkdiscard-ioctl @@ -66,6 +65,8 @@ touch -d @1434341049 use-swap-in-mext_page_double_lock touch -d @1434341882 use_GFP_NOFS_in_jbd2_cleanup_journal_tail touch -d @1434342046 recalculate-journal-credits-as-inode-depth-changes touch -d @1434342233 wait-for-existing-dio-workers-in-ext4_alloc_file_blocks -touch -d @1434342268 series -touch -d @1434342272 status -touch -d @1434342305 timestamps +touch -d @1434342778 mballoc-avoid-20-argument-function-call +touch -d @1434342803 series +touch -d @1434342826 stable-boundary +touch -d @1434342836 status +touch -d @1434342985 timestamps -- 2.11.4.GIT