linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Muhammad Usama Anjum <musamaanjum@gmail.com>
Cc: Coly Li <colyli@suse.de>,
	Zheng Yongjun <zhengyongjun3@huawei.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Hulk Robot <hulkci@huawei.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] bcache: use DEFINE_MUTEX() for mutex lock
Date: Thu, 29 Apr 2021 08:56:34 +0300	[thread overview]
Message-ID: <20210429055634.GW1981@kadam> (raw)
In-Reply-To: <0b4b7c5cc2f19d2d77a66c0d2ce42f63692174d9.camel@gmail.com>

On Wed, Apr 28, 2021 at 09:19:26PM +0500, Muhammad Usama Anjum wrote:
> On Tue, 2021-04-06 at 02:17 +0500, Muhammad Usama Anjum wrote:
> > On Mon, 2021-04-05 at 22:02 +0800, Coly Li wrote:
> > > On 4/5/21 6:14 PM, Zheng Yongjun wrote:
> > > > mutex lock can be initialized automatically with DEFINE_MUTEX()
> > > > rather than explicitly calling mutex_init().
> > > > 
> > > > Reported-by: Hulk Robot <hulkci@huawei.com>
> > > > Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> > > 
> > > NACK. This is not the first time people try to "fix" this location...
> > > 
> > > Using DEFINE_MUTEX() does not gain anything for us, it will generate
> > > unnecessary extra size for the bcache.ko.
> > > ines.
> > 
> > How can the final binary have larger size by just static declaration?
> > By using DEFINE_MUTEX, the mutex is initialized at compile time. It'll
> > save initialization at run time and one line of code will be less also
> > from text section. 
> > 
> > #### with no change (dynamic initialization)
> > size drivers/md/bcache/bcache.ko
> >    text	   data	    bss	    dec	    hex	filename
> >  187792	  25310	    152	 213254	  34106	drivers/md/bcache/bcache.ko
> > 
> > #### with patch applied (static initialization)
> >    text	   data	    bss	    dec	    hex	filename
> >  187751	  25342	    120	 213213	  340dd	drivers/md/bcache/bcache.ko
> > 
> > Module's binary size has decreased by 41 bytes with the path applied
> > (x86_64 arch).
> > 
> Anybody has any thoughts on it?
>

I think you're right and the response is puzzling.  But who cares?  It's
a small thing.  Leave it and move on.

regards,
dan carpenter

  reply	other threads:[~2021-04-29  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05 10:14 [PATCH -next] bcache: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2021-04-05 14:02 ` Coly Li
2021-04-05 21:17   ` Muhammad Usama Anjum
2021-04-28 16:19     ` Muhammad Usama Anjum
2021-04-29  5:56       ` Dan Carpenter [this message]
2021-04-29 10:05       ` Coly Li

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=20210429055634.GW1981@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=colyli@suse.de \
    --cc=hulkci@huawei.com \
    --cc=kent.overstreet@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=musamaanjum@gmail.com \
    --cc=zhengyongjun3@huawei.com \
    /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).