Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1162919
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Rasmus Villemoes <linux@rasmusvillemoes.dk> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] ext4: mballoc: avoid 20-argument function call |
| Date | Thu, 11 Jun 2015 00:30:01 +0200 |
| Message-ID | <pzWFr-34b-5@gated-at.bofh.it> (permalink) |
| X-Original-To | "Theodore Ts'o" <tytso@mit.edu>, Andreas Dilger <adilger.kernel@dilger.ca> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=FhP17X4GWIeVvuN+JGtTwy5fm5mxpl0WC2pkPFRFsaM=; b=Pn3qbZL1FP8kIcm9HowMqPTUvBZkssXzckCx+s/JY31xflaf+1sjMW5fmwp7hD919c YrxR0d+l3u0KB9g4Fqql8+bl+nHBl8qCpHFM6wsD7TtBrapiUO2BS5Sbx0X/mPa9jvm8 WiNNMIIzuX2BJvrALmCyPpmoQZuqw3rUwqSsU= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FhP17X4GWIeVvuN+JGtTwy5fm5mxpl0WC2pkPFRFsaM=; b=dZQiTcInwOHS3DSyKi+cv7uHpJEwg5Eqam+TspQ5ArJvBgXtU6cLsMbGYgxoErCYq2 9u2o/ZuqtYBteFMKH1fXME1R2DekyTSorEc12NeY6iT4Dzn2qoH//n4HXdpAGODU0TK0 hPsV/T/XXx3OUm9eBhVCSDWtM0rF6sMnL2N2zJJFyiAqhrd/3tVynHC3gTXQW8e3tYYY 5gLUhGh2ZzZ5mQnRP7iYEY3F+i2uw1/01kuRIi+xbPxQvEtZyqxxrg9T+cxUfQ2yQp6v 4fHwsLueny6gRsuU61G6vXkuZhpRjmDFfis1lKDDeHKixA7iSjn7vBL6PRLFOQlJVW9Q CCnw== |
| X-Gm-Message-State | ALoCoQkHRUgjGpQVkEzy4aIux8KA2PSB4XfgkXqNKMcV23AM933ZeBWup4Ti0Vq5S8p+2dQkzRu8 |
| X-Received | by 10.112.156.231 with SMTP id wh7mr6332755lbb.118.1433975289072; Wed, 10 Jun 2015 15:28:09 -0700 (PDT) |
| X-Mailer | git-send-email 2.1.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 38 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Rasmus Villemoes <linux@rasmusvillemoes.dk>, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Thu, 11 Jun 2015 00:28:02 +0200 |
| X-Original-Message-ID | <1433975282-20694-1-git-send-email-linux@rasmusvillemoes.dk> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1162919 |
Show key headers only | View raw
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/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[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
csiph-web