Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1162919 > unrolled thread

[PATCH] ext4: mballoc: avoid 20-argument function call

Started byRasmus Villemoes <linux@rasmusvillemoes.dk>
First post2015-06-11 00:30 +0200
Last post2015-06-15 06:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ext4: mballoc: avoid 20-argument function call Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-06-11 00:30 +0200
    Re: ext4: mballoc: avoid 20-argument function call Theodore Ts'o <tytso@mit.edu> - 2015-06-15 06:40 +0200

#1162919 — [PATCH] ext4: mballoc: avoid 20-argument function call

FromRasmus Villemoes <linux@rasmusvillemoes.dk>
Date2015-06-11 00:30 +0200
Subject[PATCH] ext4: mballoc: avoid 20-argument function call
Message-ID<pzWFr-34b-5@gated-at.bofh.it>
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 <linux@rasmusvillemoes.dk>
---
 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);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1165012 — Re: ext4: mballoc: avoid 20-argument function call

FromTheodore Ts'o <tytso@mit.edu>
Date2015-06-15 06:40 +0200
SubjectRe: ext4: mballoc: avoid 20-argument function call
Message-ID<pBulI-191-7@gated-at.bofh.it>
In reply to#1162919
On Thu, Jun 11, 2015 at 12:28:02AM +0200, Rasmus Villemoes wrote:
> 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 <linux@rasmusvillemoes.dk>

Thanks, applied.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web