Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp510483iob; Fri, 13 May 2022 06:40:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQILeiMi1di4FMxJN4KAdgcNLjQP3m6jDSJgioH+6NHJEjf2p9/Z0aLk0AnzGzxoR5oKa+ X-Received: by 2002:a05:600c:4fd4:b0:394:8e96:6d3b with SMTP id o20-20020a05600c4fd400b003948e966d3bmr4659047wmq.180.1652449206255; Fri, 13 May 2022 06:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652449206; cv=none; d=google.com; s=arc-20160816; b=ClaPmy1+MdoThWx6atGNvZ0V2x1895zx/YQMq+0JKLjgyGoiUyQQ7yNUkXMKfm18NX h3eOZ5si2q3FgJB8hjaXpTqap6a8ToM/zZXqZ9etIxmpfMvUcLacCwHPPlcjn4Ud0Tzx 7rMgzeBCYnYIar4ZUylq7QPnkgq1dkY/S0eRCqFHFp6yTe8lb/NjF9Osoc/KLy9sUg0e seez6FPQByOC0sJX1yw4p0JXziH68SdGTb+vHkFAzyeXCnG+YAkbtljzlFxEFigoTu4G hYsQAmDklIX/lsUAzovVmWDspYbtRyjwjJPyeL1nqxUup1dVVb5w/3e4iuV0jvvOo3aI /tLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=CbL4c3xKyJsggd7S9Wp62tEm4M0qyY86sdYrmgkVJBY=; b=0HJBrmO4UymkIzgfPQhLFHdtI4EPj2mETQgIgs459LIgBjdR/c7fZhgE2AcHN0Sto0 8tuh8dXUs8rKBP5uTJe9slpVMtmfG1yJbkm8d9neo+JH5ZFbICF0V+ZNinNINGXRpwN9 9SxsLJsjsuYJK115tu8vROUJyMb5qXmC2QgRNKQo6f/sVXqXkumT3By+zXUOLYZc3x+C kFEF3qbgYHeqZQ0E/NiLHS94VuPZmxxYmwPs6gUD262nTWCwRQQRDbjBP/RGt62mdGIU D5j+imgdxzsPzSyAQJinhntATElTw5iTHL30qEfMe1sagCercRME6B3KhMQljdjVoviJ 1+WQ== ARC-Authentication-Results: i=1; mx.google.com; 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 11-20020a056000156b00b0020ce076d574si2124377wrz.1018.2022.05.13.06.39.36; Fri, 13 May 2022 06:40:06 -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; 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 S1356886AbiELRKo (ORCPT + 99 others); Thu, 12 May 2022 13:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356888AbiELRKm (ORCPT ); Thu, 12 May 2022 13:10:42 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A036021B5 for ; Thu, 12 May 2022 10:10:40 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 35B681E80D6B; Fri, 13 May 2022 01:05:03 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VMlKyIXNQHXH; Fri, 13 May 2022 01:05:00 +0800 (CST) Received: from [172.30.21.106] (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id AB25F1E80D22; Fri, 13 May 2022 01:05:00 +0800 (CST) Subject: Re: [PATCH] mm: change "char *bdi_unknown_name" to "char bdi_unknown_name[]" To: Muchun Song Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220512082637.24649-1-liqiong@nfschina.com> From: liqiong Message-ID: Date: Fri, 13 May 2022 01:10:36 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,SPF_NONE,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 ?? 2022??05??12?? 23:29, Muchun Song д??: > On Thu, May 12, 2022 at 04:26:37PM +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. >> > Sorry, I do not understand what you are saying here. Creating > two variables means what? > > Thanks. Hi there?? The string form of "char *" creates two variables in the final assembly output, a static string, and a char pointer to the static string. Use "objdump -S -D *.o", can find out the static string occurring at "Contents of section .rodata". > >> Signed-off-by: liqiong >> --- >> mm/backing-dev.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/backing-dev.c b/mm/backing-dev.c >> index 7176af65b103..4982ccc63536 100644 >> --- 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)"; >> >> /* >> * bdi_lock protects bdi_tree and updates to bdi_list. bdi_list has RCU >> -- >> 2.11.0 >> >> -- ?????? <13524287433> ?Ϻ????ֶ?????????·99???п?Ժ?Ϻ??ߵ??о?Ժ3??¥3¥