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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07E33D0E6FC for ; Mon, 21 Oct 2024 11:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PggymHgfWgM5wpjT1OsAEgrjFu8ujGt/6nWR2L5mqAo=; b=DInf50ovy4m1EuIOWI2Q/KVHot h904WnUXaAO8F+Tg2/Fm2qmIpp2LKvB0R64X0Mmc2D1FjUeZaF1C2+sfBtxVtPlTbNRU/MHBl8+tR mJNIQkIdjWBaY+v3T91TzyDccYnkk43V6ESj9/m5IOop06HOsnIWr+jxdmLzoBZR7UHjHuPMWoBgy z7Ca+KIp1A62mjmHilFG9qUoI+XUmAxTuQyKjrQR/zVXWZEtOu3pHM/Po1aPTvAGU35g99alPP7KU H39MKcYX0fJ/HOZ9FTFiBFd6eHxcgfr0JzrLSWzRzEqIwO1SozOKaWuu2hxfWmkWhfl86Xaw4gzvQ 3Gu+oaEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2qwO-000000076kd-0D5m; Mon, 21 Oct 2024 11:51:16 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2qso-000000076DD-0ADk for linux-arm-kernel@bombadil.infradead.org; Mon, 21 Oct 2024 11:47:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=PggymHgfWgM5wpjT1OsAEgrjFu8ujGt/6nWR2L5mqAo=; b=TSngxUxhiCTRPRRTeV6+Wu75Cq uLQxMG2RVmJq6dxSiahEXhTXhgsJbi+6foqn0mOlVaioBeIV/hlp/9sAmnU/KlCOWFkkykQYy3/Mz q0ad/OBVQ4nypGFCX/QRLOm4vsepteBRGL6wO8IAvfkE8IdfZnLbCYs5ssqhEYGCYjOxvWtT/i9D4 uYpWdt5T12ULSTBTUki+XaGJSQyFswrFA7DTHKYSKs/JUpa9wAr7m73lclFHA1Gw6/iYI9RYIZdKV 7tKmiX92CYRWLdTjHqTo2RH50/EL8tEvC69J4I7U8A1F5n8zmu179+hKx3sUVYKT15fH9WMwx7NBX /JtUVmkQ==; Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2qsj-00000007uBC-3wUH for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 11:47:32 +0000 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 52C9EDA7; Mon, 21 Oct 2024 04:47:56 -0700 (PDT) Received: from [10.57.87.148] (unknown [10.57.87.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 824FD3F528; Mon, 21 Oct 2024 04:47:23 -0700 (PDT) Message-ID: <059721e2-5dd8-47da-b7f8-d6423f912216@arm.com> Date: Mon, 21 Oct 2024 12:47:21 +0100 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: Petr Tesarik , Michael Kelley Cc: Andrew Morton , Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , 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> <20241017142752.17f2c816@mordecai.tesarici.cz> <20241018145600.0473b1bd@mordecai.tesarici.cz> <20241018164105.0e5cc7a9@mordecai.tesarici.cz> From: Ryan Roberts In-Reply-To: <20241018164105.0e5cc7a9@mordecai.tesarici.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_124730_374217_E3E2438E X-CRM114-Status: GOOD ( 30.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/10/2024 15:41, Petr Tesarik wrote: > On Fri, 18 Oct 2024 14:56:00 +0200 > Petr Tesarik wrote: > >> On Thu, 17 Oct 2024 13:32:43 +0100 >> Ryan Roberts wrote: >> >>> On 17/10/2024 13:27, Petr Tesarik wrote: >>>> On Mon, 14 Oct 2024 11:55:11 +0100 >>>> Ryan Roberts wrote: >>>> >>>>> [...] >>>>> The series is arranged as follows: >>>>> >>>>> - patch 1: Add macros required for converting non-arch code to support >>>>> boot-time page size selection >>>>> - patches 2-36: Remove PAGE_SIZE compile-time constant assumption from all >>>>> non-arch code >>>> >>>> I have just tried to recompile the openSUSE kernel with these patches >>>> applied, and I'm running into this: >>>> >>>> CC arch/arm64/hyperv/hv_core.o >>>> In file included from ../arch/arm64/hyperv/hv_core.c:14:0: >>>> ../include/linux/hyperv.h:158:5: error: variably modified ‘reserved2’ at file scope >>>> u8 reserved2[PAGE_SIZE - 68]; >>>> ^~~~~~~~~ >>>> >>>> It looks like one more place which needs a patch, right? >>> >>> As mentioned in the cover letter, so far I've only converted enough to get the >>> defconfig *image* building (i.e. no modules). If you are compiling a different >>> config or compiling the modules for defconfig, you will likely run into these >>> types of issues. >>> >>> That said, I do have some patches to fix Hyper-V, which Michael Kelley was kind >>> enough to send me. >>> >>> I understand that Suse might be able to help with wider performance testing - if >>> that's the reason you are trying to compile, you could send me your config and >>> I'll start working on fixing up other drivers? >> >> You're right, performance testing is my goal. >> >> Heh, the openSUSE master config is cranked up to max. ;-) That would be >> a lot of work, and we don't need all those options for running our test >> suite. Let me disable the conflicting options instead. >> [...] >> I'll see if I can do something about btrfs. Then I can try to boot the >> kernel... > > FWIW the kernel builds and _boots_ after applying this patch: Amazing - thanks for doing this! > > fs/btrfs/compression.h | 2 +- > fs/btrfs/defrag.c | 2 +- > fs/btrfs/extent_io.h | 2 +- > fs/btrfs/scrub.c | 2 +- > include/linux/raid/pq.h | 4 ++-- > lib/raid6/algos.c | 2 +- > 6 files changed, 7 insertions(+), 7 deletions(-) > > --- a/fs/btrfs/compression.h > +++ b/fs/btrfs/compression.h > @@ -33,7 +33,7 @@ struct btrfs_bio; > /* Maximum length of compressed data stored on disk */ > #define BTRFS_MAX_COMPRESSED (SZ_128K) > #define BTRFS_MAX_COMPRESSED_PAGES (BTRFS_MAX_COMPRESSED / PAGE_SIZE) > -static_assert((BTRFS_MAX_COMPRESSED % PAGE_SIZE) == 0); > +static_assert((BTRFS_MAX_COMPRESSED % PAGE_SIZE_MAX) == 0); > > /* Maximum size of data before compression */ > #define BTRFS_MAX_UNCOMPRESSED (SZ_128K) > --- a/fs/btrfs/defrag.c > +++ b/fs/btrfs/defrag.c > @@ -1144,7 +1144,7 @@ next: > } > > #define CLUSTER_SIZE (SZ_256K) > -static_assert(PAGE_ALIGNED(CLUSTER_SIZE)); > +static_assert(IS_ALIGNED(CLUSTER_SIZE, PAGE_SIZE_MAX)); > > /* > * Defrag one contiguous target range. > --- a/fs/btrfs/extent_io.h > +++ b/fs/btrfs/extent_io.h > @@ -89,7 +89,7 @@ enum { > int __init extent_buffer_init_cachep(void); > void __cold extent_buffer_free_cachep(void); > > -#define INLINE_EXTENT_BUFFER_PAGES (BTRFS_MAX_METADATA_BLOCKSIZE / PAGE_SIZE) > +#define INLINE_EXTENT_BUFFER_PAGES (BTRFS_MAX_METADATA_BLOCKSIZE / PAGE_SIZE_MIN) While this works, I'm not sure if you would want to have 2 separate macros; 1 for worst-case static allocation, and 1 for dynamic allocation and iterating. I could imagine if you allocate PAGE_SIZE_MAX pages into the worst case number of slots that would increase memory. I'm not familiar with the code so don't know if this is a problem in practice. Certainly what you have done is much simpler if acceptable. > struct extent_buffer { > u64 start; > u32 len; > --- a/fs/btrfs/scrub.c > +++ b/fs/btrfs/scrub.c > @@ -100,7 +100,7 @@ enum scrub_stripe_flags { > SCRUB_STRIPE_FLAG_NO_REPORT, > }; > > -#define SCRUB_STRIPE_PAGES (BTRFS_STRIPE_LEN / PAGE_SIZE) > +#define SCRUB_STRIPE_PAGES (BTRFS_STRIPE_LEN / PAGE_SIZE_MIN) Same comment. Thanks, Ryan > > /* > * Represent one contiguous range with a length of BTRFS_STRIPE_LEN. > --- a/include/linux/raid/pq.h > +++ b/include/linux/raid/pq.h > @@ -12,7 +12,7 @@ > > #include > > -extern const char raid6_empty_zero_page[PAGE_SIZE]; > +extern const char raid6_empty_zero_page[PAGE_SIZE_MAX]; > > #else /* ! __KERNEL__ */ > /* Used for testing in user space */ > @@ -39,7 +39,7 @@ typedef uint64_t u64; > #ifndef PAGE_SHIFT > # define PAGE_SHIFT 12 > #endif > -extern const char raid6_empty_zero_page[PAGE_SIZE]; > +extern const char raid6_empty_zero_page[PAGE_SIZE_MAX]; > > #define __init > #define __exit > --- a/lib/raid6/algos.c > +++ b/lib/raid6/algos.c > @@ -19,7 +19,7 @@ > #include > #include > /* In .bss so it's zeroed */ > -const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256))); > +const char raid6_empty_zero_page[PAGE_SIZE_MAX] __attribute__((aligned(256))); > EXPORT_SYMBOL(raid6_empty_zero_page); > #endif > > > Petr T