Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp977060imw; Tue, 5 Jul 2022 01:24:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1veWuxfkmbIjwnj5Lxeu4GYAq+zjpI0vKpb+TUc/STLKtL+7SzpY01RA47o1HFbU7SRz604 X-Received: by 2002:a17:906:64d0:b0:722:e8c6:9169 with SMTP id p16-20020a17090664d000b00722e8c69169mr33127378ejn.206.1657009473027; Tue, 05 Jul 2022 01:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657009473; cv=none; d=google.com; s=arc-20160816; b=eNkbpiN0f0eEWNotpTMl/IHgx5y4sHnQaVjNV8Btuw4Qcsx2fjG6xIY4yN1FBoX9Kr Ld3TC3wZZ8gkZW979UcJGivoROJfWh8vpnj1/yJZQry0eaVzmcKUEJlYty1OZE2s6woO Xp+ONpeXNba3o7IiADUfgrFrYtP45kEimfI3eicZBf8vjdPVo7df8lGDysGA+hNZE6/5 8jUaiDkuWKaABpfpTWAbWM1aKkUSstJaZ5zT1tHRnVT4cabcOYyIZSlkYd7vfiozadrD VNCQOzZjU4pJzTrPpv01L/elzdfPEDzQtjBOFKwxbSJyR2e3t/yhbYy0rGv9dlPuRz7k vfHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=k8cdnnptoSm5AJC45vIjlcJ8J1DipiYnWtE0ruW2rxs=; b=NJAn2atRg38u40PKwwk2+RbA3dmi/bkyO201Yz/IuE3/PqbBMM35CVg02K99hBpdwf W02TfkRdOLw1hOsU9Gr3J28YHXKbVyZ8xDXc2Jl5/Zp9/0Tag1sfBVwt/PgCJbKqavZj F8GjE6WqFXN2m9k/SHekoIU2SU1klidb/gTE+1FEuVipImZTb21U/AUUtRQkXSI+2zFE e4752KqtmInKiHFNZSTBTbgax86+y9ysWeOvZwALjCv4flTNAHPjwaW7x6praP6F13JA bgPAbiKNjFSCcOunDTsssj4s/PYu0J8FjTadJR6q7RNUR7OIZFjnombhyO1pfZ8h7T2k 6lWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=hrW9cMR7; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs38-20020a1709073ea600b0072aebd63c02si376696ejc.623.2022.07.05.01.24.08; Tue, 05 Jul 2022 01:24:33 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=hrW9cMR7; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231171AbiGEHvq (ORCPT + 99 others); Tue, 5 Jul 2022 03:51:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbiGEHvp (ORCPT ); Tue, 5 Jul 2022 03:51:45 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED306DF4B for ; Tue, 5 Jul 2022 00:51:43 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id g4so20436663ybg.9 for ; Tue, 05 Jul 2022 00:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k8cdnnptoSm5AJC45vIjlcJ8J1DipiYnWtE0ruW2rxs=; b=hrW9cMR7Z3PxWD/FtQwAajFkdScrx1WIecOy3tNPSPFj7ZpT3MS6GjAIcWTagfEmKJ gkd2p1YtA2R+Hh+5XgkXthXfwg2R5jG2gKm0g6phV8Lrz5F4whqrhU83Dj4tyPwZFMtM uh781jvQ7OZBXq+KPR5Hc8P02RQW8jmkhPaUJ/ZwYrOawwLL/FrmV28X7ASFhZjVAiDC 4PMU4qslIoAXQOx4rSi7700OVzBPHPOTQk+OIii9voMpdvQNDRlo5aNm95xeq1Ki2eBG hdoFAWundROhfmqT1kj2LM1sDGiWNawV/jwFpZ3ps+48699ORO58C04c2n4NkdSQvBX9 lJrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k8cdnnptoSm5AJC45vIjlcJ8J1DipiYnWtE0ruW2rxs=; b=aBFIEK6729DnR2G5J0l70ocoi7r/I8qRQvRlZ0y9f9T/6RLCXLZNYk/PPtUtksUnxk T6UefKXQuZRAlTibnsAf2KOIF71OyXtS/Q+Y39xncq0nbyb8evFsspddcACy4x94ccQ5 mWJ01+DLgoJSiqEteIpmN6zd2hhU6WTgbd8CUuC6F//mVjyedWS+rgDA+YxU2lcClPhg Y6DN7V3uSBUnkXAXqvBx4TLc4ezxYNTrEaEuiKTDo6umVuKRPM/jnJ5oRN/S96JFplEo EkorXMCvHcCFV4y9JL7/gVg51NDNMKDXsL7EZs4UrosoeKQJQeYg0WeovUxM2AVo3mkq Wnfw== X-Gm-Message-State: AJIora/pLO3zVoqzrMhTnQhZKQjgTwOyvhx8S6yX+I+Lwcs84935nzLT pP/sRnOsejChRMDL5JsIrwBY4SkH7vWhAM+u0OnNBg== X-Received: by 2002:a25:4290:0:b0:66e:53b2:56ed with SMTP id p138-20020a254290000000b0066e53b256edmr7670009yba.254.1657007503251; Tue, 05 Jul 2022 00:51:43 -0700 (PDT) MIME-Version: 1.0 References: <20220704112526.2492342-1-chenhuacai@loongson.cn> <20220704112526.2492342-5-chenhuacai@loongson.cn> In-Reply-To: From: Muchun Song Date: Tue, 5 Jul 2022 15:51:06 +0800 Message-ID: Subject: Re: [PATCH V4 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP To: Huacai Chen Cc: Arnd Bergmann , Huacai Chen , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , loongarch@lists.linux.dev, linux-arch , Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , Andrew Morton , Linux-MM , "open list:BROADCOM NVRAM DRIVER" , Linux Kernel Mailing List , Linux ARM , Feiyang Chen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Tue, Jul 5, 2022 at 2:22 PM Huacai Chen wrote: > > Hi, Arnd, > > On Mon, Jul 4, 2022 at 8:18 PM Arnd Bergmann wrote: > > > > On Mon, Jul 4, 2022 at 1:25 PM Huacai Chen wrote: > > > To avoid the following build error on LoongArch we should include linux/ > > > static_key.h in page-flags.h. > > > > > > In file included from ./include/linux/mmzone.h:22, > > > from ./include/linux/gfp.h:6, > > > from ./include/linux/mm.h:7, > > > from arch/loongarch/kernel/asm-offsets.c:9: > > > ./include/linux/page-flags.h:208:1: warning: data definition has no > > > type or storage class > > > 208 | DECLARE_STATIC_KEY_MAYBE(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, > > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > > ./include/linux/page-flags.h:208:1: error: type defaults to 'int' in > > > declaration of 'DECLARE_STATIC_KEY_MAYBE' [-Werror=implicit-int] > > > ./include/linux/page-flags.h:209:26: warning: parameter names (without > > > types) in function declaration > > > > I wonder if page_fixed_fake_head() should be moved out of line to avoid > > this, it's already nontrivial here, and that would avoid the static key > > in a central header. > I have some consideration here. I think both inline function and > static key are instruments to make things faster, in other words, > page_fixed_fake_head() is a performance critical function. If so, it > is not suitable to move it out of line. +1 The static key is an optimization when HVO is disabled. Thanks. > > Huacai > > > > Arnd > >