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 95A2ED43352 for ; Thu, 7 Nov 2024 12:47:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A6846B0096; Thu, 7 Nov 2024 07:47:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 156CF6B0098; Thu, 7 Nov 2024 07:47:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01E046B0099; Thu, 7 Nov 2024 07:47:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D904F6B0096 for ; Thu, 7 Nov 2024 07:47:35 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8A0A3C06BE for ; Thu, 7 Nov 2024 12:47:35 +0000 (UTC) X-FDA: 82759273464.13.8998E23 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf27.hostedemail.com (Postfix) with ESMTP id 3AEAB40014 for ; Thu, 7 Nov 2024 12:46:57 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf27.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730983484; 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; bh=L5jZ67UFMuR5+p1vHH99I2vZy5VYNF4A4KwKPGbVKFA=; b=ai42AbuLBVRHPuGP/GxDxeLVngBeqU73/056D3IKXMOIK4/5d0VNLd4gmtq6yRzQ5lkLJL tCD9/UFSNzm2U8Xwkkpn7/EtAxgNd6EI0BOhJznTzvNmZjWMUBI1qONUPSr6rFCNslkuys M8Zv3RleuPnKOC1d9y+xs+5dDpnB4TI= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf27.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730983484; a=rsa-sha256; cv=none; b=BeLVvHmKfbbg0hxe1eGxkb3TNA3dj0DEo7iK2MvRua1ThtTWiCKZwbdMN5eU7wC8WwD6Kc K22qvYRqMXaVav79YrQl3GHpAaEu0vLbzO71hFxRJzgLeVQIOiMDPKv0CM7723sgUwynG/ hxT3pNpDb91bVrGwIuahS0ZlfM1in8k= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5FA7F497; Thu, 7 Nov 2024 04:48:02 -0800 (PST) Received: from [10.57.89.216] (unknown [10.57.89.216]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03C113F66E; Thu, 7 Nov 2024 04:47:29 -0800 (PST) Message-ID: <537c1a6a-6379-4c0e-9a6d-0ceaf2c43633@arm.com> Date: Thu, 7 Nov 2024 12:47:28 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v1 00/57] Boot-time page size selection for arm64 Content-Language: en-GB To: Catalin Marinas Cc: Andrew Morton , Anshuman Khandual , Ard Biesheuvel , David Hildenbrand , Greg Marsden , Ivan Ivanov , Kalesh Singh , Marc Zyngier , Mark Rutland , Matthias Brugger , Miroslav Benes , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20241014105514.3206191-1-ryan.roberts@arm.com> <083d9e98-b6b8-4702-a700-24aea95cef9e@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3AEAB40014 X-Stat-Signature: 1uzu7gsq88k8zokbhtdrwcsmzx3md568 X-Rspam-User: X-HE-Tag: 1730983617-181200 X-HE-Meta: U2FsdGVkX19YZL89Bbqk/NgaqdSVHuZNxIYk7pyhZxnuNrcJ+MAbMtdO6jFcRaIdFdsrlTqEIt+Vfk+TEFJyZ4EVlwPEqb812qczbVUmMo0NyJSFCPLVdTvLzMAkHrQvSakETEJSwSQ0AUgL3WvPsOzKNUZ04I5skvbMuy/raIJAkSaIqs2EORmgS18iZFBG8nw2a3cupVu1iUOx4iUCI3GWIn4RxO58Oasva/o3Zenm9lrrYvKUT5+yL5yFo+88VltB0fvF7BZmLXIBDVVjiQnL1QcO0iSlmG0NAa3U5DPfAOlUgrByPHGXMhclJHKYUXwAB2JkT7TN1+n/sgX48LJT6uF2XMIYmULianssFzKRn9LG0Kt3X69QWC7t1RXY+q2pxMYMBZfbwG5euA+89yQrmd9nU+YYsfPmyjSxlM+eOQGXUwYZd/2lr4jpbi9LEmzujb5i3rk97mnt4XdTI0+TRD+TF4wNhQkOrSUDSwIi1a14TuSBwkNr7kjAj75e9XOMwRmluW1DSZY0uKbdk5Ue+noB5DCXjMJ/kJeE9SmvUHHM/yqqwkrKn5EXDfA7LJFxNibX8Qd6gAhMzLizvOv3JBQlc0DQBMP9U/RXOTAiy6u7Txk+MZkVLgWfImV7mjgyEhHb9miV92d8Ts/FbENq3eZrF83j0x/II4ekGGWHF+Cw8HoWHZ/0J56UmCsUIwqUkshfL2Bn71uwQXuiiTzeWLVc4fHiHm1vyrFhO8gpVSQlL1mEBWntSMRosAOdZ6izcUVn/4nzDVeS4YNtXWaj5WQiOU+hBttKa/Yjz+tSoYRYDXF+yb1BYhm0mjiQMACowoOVEtSCFylm6AS3ZWB9R1ygoqv7+oAcd43OGdVGL+iUPKRR7L4gtUWoH322XqyQrHI22Y2XdzpsFxgbjbU37v8lU0JjE1c92UyyU7kHerGmeyzqcFdMRYQbP3izOWyMKx8FsXzDRPpnuuv 66ZgH2FJ c7kmw/89yXBqVfKJVTgfNUe9dqJDqKR8PJIm3jpj8Q9k2K/64/X55BKL6LceYJNfcTAlq1onrdjrfUKDfcXUlvajB3YoKuPwZ9zMWFGUHn/LHxh5/Fz85RJPFeT1bhTmqIGZTuy8PpbYQKMlidnY0vDdqnA== 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: List-Subscribe: List-Unsubscribe: On 07/11/2024 12:35, Catalin Marinas wrote: > On Wed, Nov 06, 2024 at 11:37:58AM +0000, Ryan Roberts wrote: >> On 31/10/2024 21:07, Catalin Marinas wrote: >>> So, first of all, I'd like to understand the overall maintainability >>> impact better. I assume you tested mostly defconfig. If you run an >>> allmodconfig build with make -k, how many build failures do you get with >>> this patchset? Similarly for some distro configs. >> >> I've roughly done: >> >> make alldefconfig && >> ./scripts/config --enable CONFIG_ARM64_BOOT_TIME_PAGE_SIZE && >> make -s -j`nproc` -k &> allmodconfig.log > > Is it alldefconfig or allmodconfig? The former has a lot less symbols > enabled than even defconfig (fairly close to allnoconfig actually): Eek, that was a typo when I wrote the email... I built allmodconfig - the big one. > > $ make defconfig > $ grep -v "^#\|^$" .config | wc -l > 4449 > > $ make alldefconfig > $ grep -v "^#\|^$" .config | wc -l > 713 > > $ make allmodconfig > $ grep -v "^#\|^$" .config | wc -l > 14401 > >> In the end, I decided to go for r'(\S+\.[ch]):.*(error|note):', which is any >> files described as having an error or being the callsite of the thing with the >> error. I think this is likely most accurate from eyeballing the log: > > I think that's good enough to give us a rough idea. > >> | | C&H files | percentage of | >> | directory | w/ error | all C&H files | >> |------------|---------------|---------------| >> | arch/arm64 | 7 | 1.3% | >> | drivers | 127 | 0.4% | >> | fs | 25 | 1.1% | >> | include | 27 | 0.4% | >> | init | 1 | 8.3% | >> | kernel | 7 | 1.3% | >> | lib | 1 | 0.2% | >> | mm | 6 | 3.2% | >> | net | 7 | 0.4% | >> | security | 2 | 0.8% | >> | sound | 21 | 0.8% | >> |------------|---------------|---------------| >> | TOTAL | 231 | 0.4% | >> |------------|---------------|---------------| > > This doesn't look that bad _if_ you actually built most modules. But if > it was alldefconfig, you likely missed the majority of modules. I definitely built allmodconfig, so I guess "this doesn't look bad" :) > >>> Do we have any better way to detect this other than actual compilation >>> on arm64? Can we hack something around COMPILE_TEST like redefine >>> PAGE_SIZE (for modules only) to a variable so that we have a better >>> chance of detecting build failures when modules are only tested on other >>> architectures? >> >> I can certainly look into this. But if the concern is that drivers are not being >> compiled against arm64, what is the likelyhood of them being compiled against >> COMPILE_TEST? > > Hopefully some CIs out there catching them. Well, if we are to fix them > anyway, we might as well eventually force a non-const PAGE_SIZE > generically even if it returns a constant. > > I'm building allmod now with something like below (and some hacks in > arch and core code to use STATIC_PAGE_* as I did not apply your > patches). alldefconfig passes with my hacks but, as you can see, the > non-const PAGE_SIZE kicks in only if MODULE is defined. So, not an > accurate test, just to get a feel of the modules problem. Nice. I guess that's pretty much the change we would add for x86 with COMPILE_TEST. > > ----------8<--------------------------- > diff --git a/arch/arm64/include/asm/page-def.h b/arch/arm64/include/asm/page-def.h > index 792e9fe881dc..71a761f86b15 100644 > --- a/arch/arm64/include/asm/page-def.h > +++ b/arch/arm64/include/asm/page-def.h > @@ -12,7 +12,19 @@ > > /* PAGE_SHIFT determines the page size */ > #define PAGE_SHIFT CONFIG_PAGE_SHIFT > -#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) > +#define STATIC_PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) > +#define STATIC_PAGE_MASK (~(STATIC_PAGE_SIZE-1)) > + > +#if !defined(MODULE) || defined(__ASSEMBLY__) > +#define PAGE_SIZE STATIC_PAGE_SIZE > +#else > +static inline unsigned long __runtime_page_size(void) > +{ > + return 1UL << PAGE_SHIFT; > +} > +#define PAGE_SIZE (__runtime_page_size()) > +#endif > + > #define PAGE_MASK (~(PAGE_SIZE-1)) > > #endif /* __ASM_PAGE_DEF_H */ > ----------8<--------------------------- >