Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2752219pxu; Mon, 7 Dec 2020 14:56:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzS1d1mlqL3anLapX4zpOGCi8UbrtKSg3bOg3TmYzwBnwCBoVujFUeZGVYTrNbYzB6jBYsq X-Received: by 2002:a50:ccc8:: with SMTP id b8mr22271104edj.152.1607381808488; Mon, 07 Dec 2020 14:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607381808; cv=none; d=google.com; s=arc-20160816; b=CSYWBXXlf3dVPKBbT5kCBufeCcViZOeixbVn74/rymAPi8LWoJNutdliPBGeDKI3MD wUam7M09liObW7g3Ht1shDYamf8LdZxRX9bF60WM/6BLXjsjs/OfWbaf7admqSXsNHxd Y9Dr66liL1quMjGk+eqEXcOwcO+S8T6LuKOIsNx0T3S5NnNzzZTO8Lr/difMJspZ4Zvx fsdzp3NYQ7MetqmFsFYpJExX0b4PM3l1XH1gEumpqpx6pgYVdSMWPXn3c+CT7TB1ithM 2cbxp3cgbICenorLhNyptjTV2ayluZXcEvtz3GM5B8Rd1Xyr7eU4a7jzSLf6m+ltux+N 0nOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bzNC1SxS8z6Rm4zQfRKnnHvCuXkRcpXV5dqScEL7UAI=; b=CyeWjtnUALS7hiwJttK22uOFU3UaYSX4x8WcYt0zu447mCzed1cxDqUmk0OqJSY0wy vP1ZnH0gbcheDjz10L7J9UkNAy+ATrrRjT0Pa4Sv1/paxRe8NoWL6CkhSw9R451Hpkt1 uPjgGyMApmKaqJkyXLv/BQdm9e4DNhd+anSVTKMmMSNBe8n/hTfHz89iXeJH2eUl7Ukg XWbFRZMeSkZCg1QqGAPX5rlNqHxZAUPWBRuFz8OaS50AaO4AvfN+7t0jbzu/79Qd+msq o4SGkHQA9Ga2Uw1+0bzv2Ig0O4YuON7dj/B7qnGwnhHqpINXJsXqG1TVdruOlw3AlFHo GAgg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si7394323ejp.67.2020.12.07.14.56.24; Mon, 07 Dec 2020 14:56:48 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbgLGWye (ORCPT + 99 others); Mon, 7 Dec 2020 17:54:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:36108 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgLGWye (ORCPT ); Mon, 7 Dec 2020 17:54:34 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 01174AB63; Mon, 7 Dec 2020 22:53:52 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 82A27603C1; Mon, 7 Dec 2020 23:53:51 +0100 (CET) Date: Mon, 7 Dec 2020 23:53:51 +0100 From: Michal Kubecek To: Alexei Starovoitov Cc: Justin Forbes , bpf , Alex Shi , Andrew Morton , Souptick Joarder , Linux-MM , LKML , Alexei Starovoitov , Daniel Borkmann , Josef Bacik Subject: Re: [PATCH] mm/filemap: add static for function __add_to_page_cache_locked Message-ID: <20201207225351.2liywqaxxtuezzw3@lion.mk-sys.cz> References: <1604661895-5495-1-git-send-email-alex.shi@linux.alibaba.com> <20201110115037.f6a53faec8d65782ab65d8b4@linux-foundation.org> <20201207081556.pwxmhgdxayzbofpi@lion.mk-sys.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 02:44:22PM -0800, Alexei Starovoitov wrote: > On Mon, Dec 7, 2020 at 10:36 AM Justin Forbes wrote: > > > > On Mon, Dec 7, 2020 at 2:16 AM Michal Kubecek wrote: > > > > > > On Thu, Nov 12, 2020 at 08:18:57AM +0800, Alex Shi wrote: > > > > > > > > > > > > 在 2020/11/11 上午3:50, Andrew Morton 写道: > > > > > On Tue, 10 Nov 2020 08:39:24 +0530 Souptick Joarder wrote: > > > > > > > > > >> On Fri, Nov 6, 2020 at 4:55 PM Alex Shi wrote: > > > > >>> > > > > >>> Otherwise it cause gcc warning: > > > > >>> ^~~~~~~~~~~~~~~ > > > > >>> ../mm/filemap.c:830:14: warning: no previous prototype for > > > > >>> ‘__add_to_page_cache_locked’ [-Wmissing-prototypes] > > > > >>> noinline int __add_to_page_cache_locked(struct page *page, > > > > >>> ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > >> > > > > >> Is CONFIG_DEBUG_INFO_BTF enabled in your .config ? > > > > > > > > > > hm, yes. > > > > > > > > When the config enabled, compiling looks good untill pahole tool > > > > used to get BTF info, but I still failed on a right version pahole > > > > > 1.16. Sorry. > > > > > > > > > > > > > >>> > > > > >>> Signed-off-by: Alex Shi > > > > >>> Cc: Andrew Morton > > > > >>> Cc: linux-mm@kvack.org > > > > >>> Cc: linux-kernel@vger.kernel.org > > > > >>> --- > > > > >>> mm/filemap.c | 2 +- > > > > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > > > > >>> > > > > >>> diff --git a/mm/filemap.c b/mm/filemap.c > > > > >>> index d90614f501da..249cf489f5df 100644 > > > > >>> --- a/mm/filemap.c > > > > >>> +++ b/mm/filemap.c > > > > >>> @@ -827,7 +827,7 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask) > > > > >>> } > > > > >>> EXPORT_SYMBOL_GPL(replace_page_cache_page); > > > > >>> > > > > >>> -noinline int __add_to_page_cache_locked(struct page *page, > > > > >>> +static noinline int __add_to_page_cache_locked(struct page *page, > > > > >>> struct address_space *mapping, > > > > >>> pgoff_t offset, gfp_t gfp, > > > > >>> void **shadowp) > > > > > > > > > > It's unclear to me whether BTF_ID() requires that the target symbol be > > > > > non-static. It doesn't actually reference the symbol: > > > > > > > > > > #define BTF_ID(prefix, name) \ > > > > > __BTF_ID(__ID(__BTF_ID__##prefix##__##name##__)) > > > > > > > > > > > > > The above usage make me thought BTF don't require the symbol, though > > > > the symbol still exist in vmlinux with 'static'. > > > > > > > > So any comments of this, Alexei? > > Sorry. I've completely missed this thread. > Now I have a hard time finding context in archives. > If I understood what's going on the removal of "static" cases issues? > Yes. That's expected. > noinline alone is not enough to work reliably. Not removal, commit 3351b16af494 ("mm/filemap: add static for function __add_to_page_cache_locked") made the function static which breaks the build in btfids phase - but it seems to happen only on some architectures. In our case, ppc64, ppc64le and riscv64 are broken, x86_64, i586 and s390x succeed. (I made a mistake above, aarch64 did not fail - but only because it was not built at all.) The thread starts with http://lkml.kernel.org/r/1604661895-5495-1-git-send-email-alex.shi@linux.alibaba.com Michal