lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 8 Aug 2018 14:52:05 +0800
From:   Sean Fu <fxinrong@...il.com>
To:     Al Viro <viro@...IV.linux.org.uk>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/buffer.c: Optimize grow_buffer function.

On Sat, Jul 21, 2018 at 07:21:16PM +0100, Al Viro wrote:
> 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@...ux-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@...ux-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?

Got it, Thanks
This size can be page size(4096) besides block size (1<<bdev->bd_inode->i_blkbits).

I have another question about __getblk_slow function in fs/buffer.c
Actually __find_get_block already was invoked before entering __getblk_slow.
Can we move __find_get_block after grow_buffers in for loop of __getblk_slow?

for (;;) {
	...
	ret = grow_buffers(bdev, block, size, gfp);
	...
	bh = __find_get_block(bdev, block, size);
	...
}

Powered by blists - more mailing lists