From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B810BFA3740 for ; Thu, 27 Oct 2022 12:49:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B1108E0002; Thu, 27 Oct 2022 08:49:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 33B128E0001; Thu, 27 Oct 2022 08:49:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 201E68E0002; Thu, 27 Oct 2022 08:49:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0D0658E0001 for ; Thu, 27 Oct 2022 08:49:25 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BAE921C6B14 for ; Thu, 27 Oct 2022 12:49:24 +0000 (UTC) X-FDA: 80066710248.04.3DE02FA Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf14.hostedemail.com (Postfix) with ESMTP id 1ACDC100033 for ; Thu, 27 Oct 2022 12:49:23 +0000 (UTC) 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 2E64FB82616 for ; Thu, 27 Oct 2022 12:49:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E142FC433D7 for ; Thu, 27 Oct 2022 12:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666874960; bh=ayJrA1JTyWdSi5OrotRFQzWnZgKlqWS2GTryuNv9C3g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TENQaZ0qX8wT35paDg5nMw/zzqDcDEv6gQ/cVQgdGrgSOg6rcYgV82zB7lSd+aKWc +im2fBZ6iDwS66vc3HKhmIPvDnkBzPWzAuPyrSgWZBgy+bdveHDvSvE1AQKBXXIAxh LUksZbDLfpInJJ/P1SCJwJjBmGBzqyoa1xU2sRP3wdoDXnDJs6eHXezpsQxybLNmeU UkuSpNW5BkYyHlEmTO/b46g/KZ5ZjdzER4j5ojkKYDlkhFith0OED+wB31MqxveAac +bZnYuUAxtnuisxPxgDeKsNxiT++anokNcEa5KmETwhByjekKjuO5E86WulWhhVDMz k5alL+wp+TuZA== Received: by mail-ej1-f41.google.com with SMTP id t25so4212548ejb.8 for ; Thu, 27 Oct 2022 05:49:20 -0700 (PDT) X-Gm-Message-State: ACrzQf0gKwE3WWQyrq4xpcT+y0xANai9Z6+1E9U7Y8mD810u56tsbyUF eGYE+CvZp8o5mIQtHl9X8AKBi3BYXi+Gg1VIDcY= X-Google-Smtp-Source: AMsMyM4y/u9sWFlXV8p8VaH9Xlg1ipNTnnAKSXBRsvzTB2BIHk4F2a4+XmGNyWABLqhGPAldl4sABjzRtQ5+fY6VgnY= X-Received: by 2002:a17:907:3ea2:b0:7ad:86f9:7b15 with SMTP id hs34-20020a1709073ea200b007ad86f97b15mr4488706ejc.272.1666874959084; Thu, 27 Oct 2022 05:49:19 -0700 (PDT) MIME-Version: 1.0 References: <20221024070105.306280-1-chenhuacai@loongson.cn> <20221024070105.306280-5-chenhuacai@loongson.cn> <3eb9b612-e765-7ad0-aed8-a50e28677e9c@linaro.org> In-Reply-To: <3eb9b612-e765-7ad0-aed8-a50e28677e9c@linaro.org> From: Huacai Chen Date: Thu, 27 Oct 2022 20:49:07 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V13 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: Guo Ren , Huacai Chen , Arnd Bergmann , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Dinh Nguyen , loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Xuerui Wang , Jiaxun Yang , Andrew Morton , linux-mm@kvack.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Feiyang Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666874964; a=rsa-sha256; cv=none; b=24LyCFAlj32gzx8eQX2BfxAA/kYdLWvJ+BuB3h5mt8z89pAdKeuqwduQTunm/Y7GWP6TsS C4cV0U9Fj0hoPbO1LktXmcE5JpMUcFCAjvgSqHSsBkuiDDFUZ0WH25rqBv3NLNAyb9h3Jy ZDUQ65nJq3CL4vfL+LfwGXCQH/P38YU= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TENQaZ0q; spf=pass (imf14.hostedemail.com: domain of chenhuacai@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=chenhuacai@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666874964; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TykZV9J5wCifqHnVA2hnZhCt4t7gmNMj9UEAhrXvQvU=; b=CjDN8bwvv2lgN6U4KNZ7KqfWKyyl5vvKk5Y+9qd42jMQdzijXllUEsZxWO67PJGsrFhwuJ gSD2onv2RpEV6d2QCZKtr88wfAJZkXPlX3/5Mc7fsJyvjiJC1SFqjJmy560ttQjexEWjcI fn4WCZVL4mS96BVm1BDbX6CfLlpvnCw= X-Stat-Signature: ckisis6eegcjswi4o4xsygr5s44y8oid X-Rspamd-Queue-Id: 1ACDC100033 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TENQaZ0q; spf=pass (imf14.hostedemail.com: domain of chenhuacai@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=chenhuacai@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1666874963-18031 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 26, 2022 at 9:44 PM Philippe Mathieu-Daud=C3=A9 wrote: > > On 26/10/22 14:59, Huacai Chen wrote: > > On Mon, Oct 24, 2022 at 4:04 PM Guo Ren wrote: > >> On Mon, Oct 24, 2022 at 3:05 PM Huacai Chen w= rote: > >>> > >>> From: Feiyang Chen > >>> > >>> The feature of minimizing overhead of struct page associated with eac= h > >>> HugeTLB page is implemented on x86_64. However, the infrastructure of > >>> this feature is already there, so just select ARCH_WANT_HUGETLB_PAGE_ > >>> OPTIMIZE_VMEMMAP is enough to enable this feature for LoongArch. > >>> > >>> To avoid the following build error on LoongArch we should include lin= ux/ > >>> static_key.h in page-flags.h. This is straightforward but the build > >>> error is implicitly a LoongArch-specific problem, because ARM64 and X= 86 > >>> have already include static_key.h from their arch-specific core heade= rs. > > >>> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h > >>> index 0b0ae5084e60..1aafdc73e399 100644 > >>> --- a/include/linux/page-flags.h > >>> +++ b/include/linux/page-flags.h > >>> @@ -9,6 +9,7 @@ > >>> #include > >>> #include > >>> #include > >>> +#include > >> Em... riscv needn't this. > > Would guarding the header suffice and make riscv OK with this patch? Emm, since LoongArch has no build errors due to an accident now, I will send a new version without static_key.h inclusion. If one day the build error comes back, we can send a separate patch to fix it. Huacai > > #ifdef CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > #include > #endif > > > I found that after 36d4b36b69590fed99356a4426c940a25 (" lib/nodemask: > > inline next_node_in() and node_random()"), build errors have gone. But > > I think this is just an accident. Because that commit adds random.h > > inclusion in nodemask.h, then asm-offsets.c --> sched.h --> nodemask.h > > --> random.h --> once.h --> jump_label.h. If one day this chain is > > adjusted, then build errors come again. > > > > On the other hand, page-flags.h is obviously using some static_key > > macros, including static_key.h is straightforward for building. > > > > Huacai