Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp378194iob; Fri, 13 May 2022 03:51:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycWh/7kL/V6jLboBNmWQM+Ltp0xrVSmFbnV5/D/7RFMYEFOC3/FphAN39QYNnDdwYa+A8Q X-Received: by 2002:a05:600c:3b0a:b0:394:6373:6c45 with SMTP id m10-20020a05600c3b0a00b0039463736c45mr14213726wms.69.1652439095830; Fri, 13 May 2022 03:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652439095; cv=none; d=google.com; s=arc-20160816; b=vR19x+hWqkLasM38oLyHPHnBJ97J5swy0Ba9/u5e69KA4nupudyDpjaB3yk2g9o0Tr QsqAtAOsofQ/C0BL1Rb3sBzwYl03+kRGPT5lUBtkUxO/78iRhfCPdxOKWA4QqP4fL6xC Om/TKc7/egZjbXBSwCTEuRTIU39Hm8iGXBfykp0MlselTNz9iP5WwxKaaYNBybYLjx8p 5dLSdh0yF3qVVTUf+vttYc1FZLuBHQLbHN1oCh8Hz54nza6hTzfq5OkbqZyvv8oYF6X6 0NF0qsvvaFyMjcOscrUHhDq8KBiiFch2HTrxSMaR8KuZ6Fjrs0s/1PsOA+H7rDdXBp5j IVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=3LWPtpGlahq1korXjoZzuVZXfyrrbqzrnE6k2HCihKM=; b=ZqfgInRX2CkoMw0hNcL1CPwkcALA3qcxonxaenTccMzoYzLQMsvpotw//UxcSgdEH6 Pt2K37r2F7h1NhfHtx/yCDA3e2dpi9JGnmmbEoydqN3WYhzgv8ZBr3ZPZ1r23r3xdNjW BX6yqM5S413Hjud6UTOrgK2k9fXUzBQnQsGflVR3fl4CL//OlrmyR23Ijs9YmHz2xSfx QsNWSTqxeYGJaAIEhW8a13cB7cFEAfSLEVPe3BprPmjipapt/ubIba9DYupjsQxmzqeW VOdx8wCyynoMez2hhVx4ttmyZn/Dn/FDye1L8Dq7YRTc7HbrTqD+9/gahQMlAA72P+0a +5sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=YKi3IOX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a056000186500b0020c61461322si2585500wri.329.2022.05.13.03.51.08; Fri, 13 May 2022 03:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=YKi3IOX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358237AbiELUA5 (ORCPT + 99 others); Thu, 12 May 2022 16:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232085AbiELUA4 (ORCPT ); Thu, 12 May 2022 16:00:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762F04704F for ; Thu, 12 May 2022 13:00:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2D527B82B1B for ; Thu, 12 May 2022 20:00:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D09F4C385B8; Thu, 12 May 2022 20:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652385652; bh=gj5imhNP1kGbjLtES03/wUeaRho9QAjqu8qpTgUzxvc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YKi3IOX2stMb8eNuUxfBVl80Bs/rLWGkKHxwnnm2xhETa4PR35vXp6B4jd3pFWtNT QrZYRMmndeMN7V6bkN7d0VUgVVRdDvuO+FsB621k0G5bzU0G2SIfEja6m+zE0lQTnS UkwQdGNsNYDLkKWHHvf7jgUHC/0V3RwyGSYVa+II= Date: Thu, 12 May 2022 13:00:51 -0700 From: Andrew Morton To: liqiong Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: change "char *bdi_unknown_name" to "char bdi_unknown_name[]" Message-Id: <20220512130051.94a0c53e5d1498292473975d@linux-foundation.org> In-Reply-To: <20220512082637.24649-1-liqiong@nfschina.com> References: <20220512082637.24649-1-liqiong@nfschina.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 May 2022 16:26:37 +0800 liqiong wrote: > "char bdi_unknown_nam[]" string form declares a single variable. > It is better then "char *bdi_unknown_name" which creates two > variables. > > ... > > --- a/mm/backing-dev.c > +++ b/mm/backing-dev.c > @@ -20,7 +20,7 @@ struct backing_dev_info noop_backing_dev_info; > EXPORT_SYMBOL_GPL(noop_backing_dev_info); > > static struct class *bdi_class; > -static const char *bdi_unknown_name = "(unknown)"; > +static const char bdi_unknown_name[] = "(unknown)"; > heh, fun patch. We actually do this quite a lot. grep -r "^[a-z].*char \*[a-z].*= \"" . is a pathetic pattern which catches a lot of them. However. I expected your patch to shrink the kernel a bit, but it has the opposite effect: hp2:/usr/src/25> size mm/backing-dev.o text data bss dec hex filename 21288 9396 3808 34492 86bc mm/backing-dev.o-before 21300 9428 3808 34536 86e8 mm/backing-dev.o-after Even .data became larger. I didn't investigate why.