Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1100561pxy; Wed, 28 Apr 2021 22:58:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGN0uQcRjh+mb1G+Tedj/crLb0EIef3Jj5H1yzkHCqBUCmhMCC87JBjZ3ukBswiEyByZsx X-Received: by 2002:a17:90b:1bc1:: with SMTP id oa1mr35041144pjb.46.1619675936905; Wed, 28 Apr 2021 22:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619675936; cv=none; d=google.com; s=arc-20160816; b=QFZ8wrMxIV6Yh4sMpZsEynX45Aw1kFBWLbIeZpgF5WrGFlpGc8J8CAfAVisNFj8oAh ZVIfUgJIGgg5oMrcGMvPFu07/hbb1ZDlRMMgirwr6K7url0lXhKEmH+nTuBhKJVozZw1 6Q1g5IunQSxxQTJIDXP4wMF4XWS0x8jeGxMq31C7UcEy9aMPVq35ycd7LVIKa0T/M0Nd B5wa3Ib6ZstHIN3HpkOgMK0/HP/yrkjgrhKP16RYXg2sxQIOAy9O7gBdXizEequQ0qci cTvUHb1mguANEKosxoBGOyap1F8SLiSWJZ6P36k7YMMI2FWJszpzjfT9E/NHeHyYrXnU yExg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hGTyGt9noPt67Cw1LsQXYDQXCJu92JsiJuvxMAxCMMM=; b=AHH2QExdUb43vF+Vk8UN8bgVbAd4+whrw2Qnf8+/6Sj8zFD9snnXppU0ppde3lqOyT Tn5HKm6ATlqBCjYuRGLndE/JTc195RtQFahQTZcR1w+S+FWtGyJc8Fr+aQyb6WE2eAoq d9VvmmnaPtr03aZv6yPR2TSPDl57E3CqcAAbgQz1IkH+DXDdFsgCVSg7w5IHTU2eZTGg RIkN6HUGud2Npu5TF7kNr4eFNaR8BxYNPAiOfSkTArg6R31hvRtq/8lKckADORl2ghI7 5wm2kh4s6BrLiqX0BvC4DMJSZWihBjO7i7Wbsats92aWukY8veqcGT7k5MgTuZvkJDPI /oEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Qvmzx64V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr17si2240924pjb.90.2021.04.28.22.58.33; Wed, 28 Apr 2021 22:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Qvmzx64V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236966AbhD2F5k (ORCPT + 99 others); Thu, 29 Apr 2021 01:57:40 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:60450 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbhD2F5j (ORCPT ); Thu, 29 Apr 2021 01:57:39 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13T5sTMo189481; Thu, 29 Apr 2021 05:56:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=hGTyGt9noPt67Cw1LsQXYDQXCJu92JsiJuvxMAxCMMM=; b=Qvmzx64VuqWu0acTsyHbvRzHxKl5/RQOnbPHfTSRFkp7TWHHvdB//von1yV+hujZSPRj TwgCE+c5VjNtfhi9JmBUHKETzqbWx3XtYEDhZcw56eM9jIeR0But4iNgR4BZkxkoMCTr JKVGyLt5+LK229yWP/mAoYlDXKRO4B9i93Ey6d5IEpZpNCk6pGoZyOpOHS9lH9CB+K7k lNcrpPIahV/JSNObMOpQMZQpR5WmnxVPJWg5vLAkETZf+ov+x5kwXPni9rzjglDk3Ilk 4bIbTF8QXwQC9vh34TZOXYiHNAY3IrmQqJqBOHpSPQEUgQ/sbkp5qmOS39Nd9XsngP3Z AQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 385aeq33ka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Apr 2021 05:56:43 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13T5sqgJ162583; Thu, 29 Apr 2021 05:56:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3030.oracle.com with ESMTP id 3848f0k264-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Apr 2021 05:56:43 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 13T5ughd166809; Thu, 29 Apr 2021 05:56:42 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 3848f0k25t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Apr 2021 05:56:42 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 13T5ufk1022348; Thu, 29 Apr 2021 05:56:41 GMT Received: from kadam (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 29 Apr 2021 05:56:40 +0000 Date: Thu, 29 Apr 2021 08:56:34 +0300 From: Dan Carpenter To: Muhammad Usama Anjum Cc: Coly Li , Zheng Yongjun , Kent Overstreet , linux-bcache@vger.kernel.org, kernel-janitors@vger.kernel.org, Hulk Robot , linux-kernel Subject: Re: [PATCH -next] bcache: use DEFINE_MUTEX() for mutex lock Message-ID: <20210429055634.GW1981@kadam> References: <20210405101453.15096-1-zhengyongjun3@huawei.com> <42c3e33d-c20e-0fdd-f316-5084e33f9a3b@suse.de> <0b4b7c5cc2f19d2d77a66c0d2ce42f63692174d9.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b4b7c5cc2f19d2d77a66c0d2ce42f63692174d9.camel@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-ORIG-GUID: kYTj2TlPmLhcVFf4NH8LINeIEXi0YT8g X-Proofpoint-GUID: kYTj2TlPmLhcVFf4NH8LINeIEXi0YT8g X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9968 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1011 suspectscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104290046 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > Signed-off-by: Zheng Yongjun > > > > > > 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