lkml.org 
[lkml]   [2018]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs/buffer.c: Optimize grow_buffer function.
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?

\
 
 \ /
  Last update: 2018-07-21 20:22    [W:0.041 / U:1.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site