Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp271761iog; Thu, 30 Jun 2022 00:01:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1tQy2NgoO0b7ZjTn22roguzeU2+TPHlb+4A8zxBl8+NwQLn1cR1y+zmcZ6WTIO4JUukz/ X-Received: by 2002:aa7:c6d9:0:b0:435:706a:4578 with SMTP id b25-20020aa7c6d9000000b00435706a4578mr9738335eds.24.1656572481588; Thu, 30 Jun 2022 00:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656572481; cv=none; d=google.com; s=arc-20160816; b=QQb2crEAw7rTJB1iCYaUa/UCQa3cC45sSDAzTSy5DyFgRXKPfy1oKQQ0ZdWPk5TsJx JtEe2uHdzh85FJahmrs3hXY81M7RyqRe1HO06/JRhKO2Z4Z8xRm8RxV8AOAVdbREWOj3 jXMVFs1cpt9zhwghqq6qj3rqOTyIn54aZX6ykbSmFUo9oMubvLN8U0QgmSu7d8WlOpo2 s2VREyzboedbQaopQpEAPgZbC9CoYnb3zq6AXD7/W5bK5SUEkcU5fznC7BeqJ4npyZP5 rZAqkt+rvRZ+Gi9TRcVT26UmJhaFrLX2EnMwggjT8pqNZ73ULjemE3PgBQtIoYvsVhTe eSfQ== 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=9T64cR/FufP6/CunzmPu+rS6tL4/EEVZVw0GWwm9EzE=; b=EGvFzBVl+U/OtYNcSDfusX4qvoId+mgGKPfcELI1QGTJ0rM/RRdCWRHaUP51YSacSn 8XzCKVJwPWpWc85yWSvfB28UQHLYXWF9npIa1LF/1ICsz/gVzBxo3dz0nLbCk2Y9ye6Z JPPcHYrpEpk0zr6bbbFi4/jjiA4mhS+MLyl07lmsIO2nousRs1ZTMgLhzUu7jPRP0yao YOG+wuh2jShbVJwh9eklbiX4rh79zo+/GX2PaEwgq4C5UEKDH16VM/e5W3IyECBfI1KL 5vaDQld8CxzcQKvtZfTwj95RrmKbDeRtFemgTdzi+LOB/Vqf0QXMdczwRezMnMNo0pBy VxQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nl5CzODx; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a17090658d300b006fed9433169si27313516ejs.826.2022.06.30.00.00.39; Thu, 30 Jun 2022 00:01:21 -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=@gmail.com header.s=20210112 header.b=nl5CzODx; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbiF3G4K (ORCPT + 99 others); Thu, 30 Jun 2022 02:56:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiF3G4J (ORCPT ); Thu, 30 Jun 2022 02:56:09 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8855832069; Wed, 29 Jun 2022 23:56:08 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id a39so20694303ljq.11; Wed, 29 Jun 2022 23:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9T64cR/FufP6/CunzmPu+rS6tL4/EEVZVw0GWwm9EzE=; b=nl5CzODxaap3kUpQ3c2ewioKttk0evPfzAmsXqdVyJfDD8Xz+h/P9z06jbmly4yY7L /SM81HeOvWYYR0bESzaNPrOyZkAsFvQIjXs194O9V8hUZkGD02pFl87F8XvIsCO+LlWv mkecnJBaPs4XiX7XR3NVe5iGdkM+0fGDXQ50hC0hcvxwOJf4ZKwmlrSa6jYlba9pQc9w T7fp9kDH3QmsLOkOhsJPm3WXqFH2iFPXVYbxfLCZViV5EDzIyz6oMIMFmzVd/t9KU61S UkykkTPPYWyMxXlgV5ldCyrJkG2Wg5OMuNDb+cllPJ+UdoQLg8xNwuYJts5K7Oi0xqEb rw1A== 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=9T64cR/FufP6/CunzmPu+rS6tL4/EEVZVw0GWwm9EzE=; b=UsICWDL5saxo7dpvUBl1ygaff1jzRFBjDRY4/vaCQhfDcul+9NFU+y0ABFhVMVnPO5 95c46faMUM78d73g7pXJ5ropakAz744nmQ3UFHwjh7nH7zU6dEus3azn1rqcNixI9bf9 xQQb07cE/n6ABbRkONyD2flw8Hw2tjJyCYHPuT/TB+9dpNZOqvvh0zMiEWesMoCiGs8a oyGAqMYnFlQO8SPzql7gbG6izGFKob9fjVjxci7AbAjlqRqNkFCB7vRLfocDE2E+jtdP 4MikPIpzX4yGrxT240s586K7OfRukTkKG63KElkqieNk/RnsejOceU1ueEAUpo2zZJD9 0HKw== X-Gm-Message-State: AJIora/5q2IEcHmGAoz1AmRNSdHFUWHMuFcQU9YBsiP716s1odJGohFb u258QpfxlWoid83dBZ7CScq9SvF1QtkGVinSDZW4EMoLwDk6Nw== X-Received: by 2002:a2e:4e12:0:b0:25a:9d28:7d6b with SMTP id c18-20020a2e4e12000000b0025a9d287d6bmr4218881ljb.482.1656572166748; Wed, 29 Jun 2022 23:56:06 -0700 (PDT) MIME-Version: 1.0 References: <20220630043237.2059576-1-chenhuacai@loongson.cn> <20220630043237.2059576-5-chenhuacai@loongson.cn> In-Reply-To: From: Feiyang Chen Date: Thu, 30 Jun 2022 14:55:54 +0800 Message-ID: Subject: Re: [PATCH V2 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP To: Arnd Bergmann Cc: Huacai Chen , 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 Thu, 30 Jun 2022 at 14:07, Arnd Bergmann wrote: > > On Thu, Jun 30, 2022 at 6:32 AM Huacai Chen wrote: > > > > To avoid build error on LoongArch we should include linux/static_key.h > > in page-flags.h. > > This is an expensive change in terms of compile speed, as static_key.h has > lots of dependencies, and page-flags.h is included in a lot of places. What > it is actually needed for? > Hi, Arnd, If CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y, the page-flags.h relies on static keys. If we don't include static_key.h, we will get the following errors when compiling. 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 209 | hugetlb_optimize_vmemmap_key); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/page-flags.h: In function 'hugetlb_optimize_vmemmap_enabled': ./include/linux/page-flags.h:213:16: error: implicit declaration of function 'static_branch_maybe' [-Werror=implicit-function-declaration] 213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, | ^~~~~~~~~~~~~~~~~~~ ./include/linux/page-flags.h:213:36: error: 'CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON' undeclared (first use in this function); did you mean 'CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP'? 213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP ./include/linux/page-flags.h:213:36: note: each undeclared identifier is reported only once for each function it appears in ./include/linux/page-flags.h:214:37: error: 'hugetlb_optimize_vmemmap_key' undeclared (first use in this function); did you mean 'hugetlb_optimize_vmemmap_enabled'? 214 | &hugetlb_optimize_vmemmap_key); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | hugetlb_optimize_vmemmap_enabled Thanks, Feiyang > Arnd >