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 4A098D43352 for ; Thu, 7 Nov 2024 12:35:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 967066B0096; Thu, 7 Nov 2024 07:35:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 916F86B0098; Thu, 7 Nov 2024 07:35:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8058D6B0099; Thu, 7 Nov 2024 07:35:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6122D6B0096 for ; Thu, 7 Nov 2024 07:35:39 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0261F1A03C9 for ; Thu, 7 Nov 2024 12:35:38 +0000 (UTC) X-FDA: 82759243392.13.D20927F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 862EA1C000A for ; Thu, 7 Nov 2024 12:35:21 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730982852; 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: in-reply-to:in-reply-to:references:references; bh=+UmpOQw8zuRGya0xzGUDJxvT1+Zri4pO+UBWJC150Dk=; b=ZH8gdQ2xIkqgCm0OanOKZMJzt/iF3MTXn8m5YZDgwSmRqFhKn8MLPyIlSeWxbYYss6A6yd 05KaDJbUMRKBhMOsXqqox36GB004whtOymaMo+O6yY5tEwdUKmr6sC3Ug0ljICLy4rmWF2 lPXrddpDzoMyiVPx5RzlP+MXUW3QLdc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730982852; a=rsa-sha256; cv=none; b=dGXZ9wRftL1NBuSR6XoPrlu9Bm1y5tjmeXE9eYM32sxXxoFjrozKz638YUe5THjRQ+z3Pq r2lfMBgDCJaPssjLO3qaJMWKT+RkgYAazdjyb6WrbQZ4mpPp8PUwpW3Wg/rdWxubqZYGev Z9G2jH7C/ExY/tTGs0Yx6uDO/zELbkU= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6E5345C584D; Thu, 7 Nov 2024 12:34:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21F6EC4CECC; Thu, 7 Nov 2024 12:35:32 +0000 (UTC) Date: Thu, 7 Nov 2024 12:35:26 +0000 From: Catalin Marinas To: Ryan Roberts 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 Subject: Re: [RFC PATCH v1 00/57] Boot-time page size selection for arm64 Message-ID: References: <20241014105514.3206191-1-ryan.roberts@arm.com> <083d9e98-b6b8-4702-a700-24aea95cef9e@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <083d9e98-b6b8-4702-a700-24aea95cef9e@arm.com> X-Rspamd-Server: rspam10 X-Stat-Signature: pukcynjyjpmcxokn356fwaje6xrntgsx X-Rspamd-Queue-Id: 862EA1C000A X-Rspam-User: X-HE-Tag: 1730982921-52578 X-HE-Meta: U2FsdGVkX19oUCIhufXVk8z9kdt73hZFC84zlGyw7X8+w+EtAf4AtH4TsaOQdU5XeBC1VF7m92uw3T1WtcTHY+X09tgn79Yl70Wpxn487dYBtUPd0b1AJQw7C15izvZeTJ4vPd7Wo8mLvm7J02HrHfPKdOXdOja4rn5dTPg0co1GrYDJMCrUFUqnivHBWa6ehe03DeXYeKCdr7AFCUntL/c9W7rlxk9mrodNx5bxsXBs9iOsE5yBSWSqoKa/29guAfBgGRJ3qvmsogCqNo7TkkgLzbKPBl9beSsvZxAo7z0d9yKsfHLSgOedd09HAOJKiKN/fkXgskmnuxpJjrwYU9YxFd4TuZ7E23/ccr4DnjeAIxaogak4+8Q64RVhGv3nEGo2YwqAK+UGIURTO87qX5SfWfySfKrShv8TEUuJ/lrSLeyIfpp2pIyttAEOsU2/GVtXcaz+jTAhKNyV641ilsK9cJbBkI2Hy+K7SVomiRMrCz2ntYt+dxpoSCzzidAokucxaDMdKmcXVfZiqt3VGna3gmPuCmVIHncXbeONG7ErHJWp52wn5SqF89OaE6jSJemOsK1P5zml/k3agMIdpIj0BiX14YmsG7ee4jyVSC3y0bqc+hLx2o9x7OnS0WWjNeXksWSJxaDswORGyvRBdWrrnqykYqhc1Gw6qWgwMZY7Z5Y13mATQ7aIfkMi8URz1oO8E+8cYew9BttVggMysJJnvOWQRKbMFP54Ew9Zp/NaiD4MwMJp2FmrooTi/gwnJ5GkEAqttVsbDPIqZgvXKR8T4CISSTyio+5CpFdSx5nObQlkpxw2uEnzeuhxmYZ/rhq6PMBxowKTVx94baO6NatGN3brLYsbPklm0COqG95Bfjl5Kf14oME5CljPcATKC2LjQqMm1IOrLgSJDEfWFh+ARh/eiX+l5jQACiw1Nk7l29HgJBZ+wBZTLklB0y3jaWMgJ+vQl4k10UpeQ0w CrFYC9lQ eEFWwbItSPFkFdgZxrnmc3M9zRYfVHJOdsRcDo2pBkhKA06g81hE9cO+oD5jCyJfHiDPftGCYfAaPkMeBXkxG6EeEUPJmEKpjDUvjgAC7OYQz2WOYGgtrVMkhL/ZTcRJkO10KbcX83M1Eyr+lbBoUTel/NTTJ0YdedAY26cw7WQWGHJHi3ka2PZ7qV9JHZvlF9U3+hk9087welBjlzI2R7P5kl6X5b1+DjZvX/ckIdin3qG/Hurf7G5cK+/PAJVn0z+KJlMZPeXQf2XJYfv4HP74fmCd7dhqLAbgDy5bc3jcmK3GyQJb4mlofEuouUrJLs+JErfB3T80gEwp8bWAK2ZLstFbmU46Uq8gf 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 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): $ 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. > > 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. ----------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<--------------------------- -- Catalin