From: Al Viro <viro@ZenIV.linux.org.uk>
To: Sean Fu <fxinrong@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/buffer.c: Optimize grow_buffer function.
Date: Sat, 21 Jul 2018 19:21:16 +0100 [thread overview]
Message-ID: <20180721182116.GC30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1532194217-19002-1-git-send-email-fxinrong@gmail.com>
On Sun, Jul 22, 2018 at 01:30:17AM +0800, Sean Fu wrote:
> Use PAGE_SHIFT and i_blkbits of bd_inode directly to avoid ugly sizebits
> calculation.
> Remove ugly sizebits calculation.
> Remove unnecessary sizebits parameter of grow_dev_page.
>
> Reduces code size:
>
> Before:
>
> sean@linux-zmni:~/sda5/source/linus_repo/linux> size fs/buffer.o
> text data bss dec hex filename
> 34037 1510 16 35563 8aeb fs/buffer.o
>
> After:
>
> sean@linux-zmni:~/sda5/source/linus_repo/linux> size fs/buffer.o
> text data bss dec hex filename
> 34021 1510 16 35547 8adb fs/buffer.o
First of all, 16 bytes is pretty much noise. What's more, the "remove ugly
sizebits calculation" part really needs an explanation of the reasons why
it's safe. You assume that size == 1<<bdev->bd_inode->i_blkbits; where's
the proof that it always holds?
next prev parent reply other threads:[~2018-07-21 18:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-21 17:30 [PATCH] fs/buffer.c: Optimize grow_buffer function Sean Fu
2018-07-21 18:21 ` Al Viro [this message]
2018-07-24 9:42 ` Sean Fu
2018-08-08 6:52 ` Sean Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180721182116.GC30522@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=fxinrong@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).