From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:35056 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728418AbeGUTOz (ORCPT ); Sat, 21 Jul 2018 15:14:55 -0400 Date: Sat, 21 Jul 2018 19:21:16 +0100 From: Al Viro To: Sean Fu Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs/buffer.c: Optimize grow_buffer function. Message-ID: <20180721182116.GC30522@ZenIV.linux.org.uk> References: <1532194217-19002-1-git-send-email-fxinrong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1532194217-19002-1-git-send-email-fxinrong@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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<bd_inode->i_blkbits; where's the proof that it always holds?