Message ID | 20241014105912.3207374-9-ryan.roberts@arm.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 A0D5CD1A43B for <linux-mm@archiver.kernel.org>; Mon, 14 Oct 2024 10:59:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F83E6B0093; Mon, 14 Oct 2024 06:59:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 35A966B0095; Mon, 14 Oct 2024 06:59:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 221BD6B0096; Mon, 14 Oct 2024 06:59:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id F38026B0093 for <linux-mm@kvack.org>; Mon, 14 Oct 2024 06:59:57 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3A00C1C6129 for <linux-mm@kvack.org>; Mon, 14 Oct 2024 10:59:49 +0000 (UTC) X-FDA: 82671912792.29.10001B9 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf15.hostedemail.com (Postfix) with ESMTP id 2B8B9A0004 for <linux-mm@kvack.org>; Mon, 14 Oct 2024 10:59:49 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf15.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=1728903565; a=rsa-sha256; cv=none; b=Zft4J5m2Y15+KOmy7Am64OHuLbPy00/f4ymWTRQyrZ9gXylUrMZMEkBCwPOYoMnFqOWq/B ee9MVPih1HG1cW5o6jaCv0V7aPJXaObeqoU9zXF+NIhsY84S2xm7XPvhQMVXP8ilKRkMjn FLv+JDGVWT8FGjKMKc5/FR8oaJkkKgo= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf15.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=1728903565; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HQvPCF1x2W8nC78duvmTyHGJn39OjXD+rSjYpslxs/Y=; b=dzxeM5yQbQ24yW/QI8VQXIwua1hI7/cq1i0A35CU0iq3ihz5mQe2VxotxWVPbXuRYPTPi9 rjccB0x413eGIFUw+psTeg8jjj9BqKmchyO1T6TRePSEmB2mr2CW48Al9iORbW7GjuIDvV KS7qY5tNv/CBXetdpFdRk3k/XkvDpxI= 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 2D6B51424; Mon, 14 Oct 2024 04:00:25 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C5CEC3F51B; Mon, 14 Oct 2024 03:59:52 -0700 (PDT) From: Ryan Roberts <ryan.roberts@arm.com> To: Andrew Morton <akpm@linux-foundation.org>, Anna Schumaker <anna@kernel.org>, Anshuman Khandual <anshuman.khandual@arm.com>, Ard Biesheuvel <ardb@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, David Hildenbrand <david@redhat.com>, Greg Marsden <greg.marsden@oracle.com>, Ivan Ivanov <ivan.ivanov@suse.com>, Kalesh Singh <kaleshsingh@google.com>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Matthias Brugger <mbrugger@suse.com>, Miroslav Benes <mbenes@suse.cz>, Trond Myklebust <trondmy@kernel.org>, Will Deacon <will@kernel.org> Cc: Ryan Roberts <ryan.roberts@arm.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org Subject: [RFC PATCH v1 09/57] fs/nfs: Remove PAGE_SIZE compile-time constant assumption Date: Mon, 14 Oct 2024 11:58:16 +0100 Message-ID: <20241014105912.3207374-9-ryan.roberts@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241014105912.3207374-1-ryan.roberts@arm.com> References: <20241014105514.3206191-1-ryan.roberts@arm.com> <20241014105912.3207374-1-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Stat-Signature: tiurocajj8bihqejywr5nm3xzci1ha8z X-Rspamd-Queue-Id: 2B8B9A0004 X-Rspamd-Server: rspam02 X-HE-Tag: 1728903589-944605 X-HE-Meta: U2FsdGVkX1/+4W2M9F4X6ry2bq345IO+q/Y6g3wLl8efUdEp+y5+rGcQ8INdTkT1fCZ/5bddNCMPG9SsxR0NdhawG62+RMOadtNLrrS0oc8Ii9+44f+zKGCZV0zrJKQF3Gn3TOeoeV/RD0uIb8NaHSCXb8qD8JTWK6GvyT0krtqCSf1JCDe1dhsEHiVHoa0c+RhM7rAu12EKiVeENNK6GMFwwqFddTfK9IQ/yBHg86WyoQyiXXfC9CsTo9EGPITSOi3n42DGIDJRKydKKFj8Xz9sVGFslJows07ZKOs795+HgvnkRFlRin/jpPZZk1NfJClkt/8/9gLNi6k8eLIAsRFXPyN7OXWcIdfLzFViSRuwAHFQQ+fGRmJq51Q8UPQmJ217MKxJbcjbwuHA7nyyigQVEa94N59/PjheZcgJ5wJhrV8a2GDPKYZgPUh1VVA2WN33RWTpjMkoEAI2wEaAuXMvHyicpA61K8C133uoZEM1CPIQQLbezdeC+NiwMbKxHl3aHYK5LQo+NQvRjlwmsyjncgEb+v2R4J2LYKv1FWxMuul/LWWLWC/1WaHDcijvFBsODxADoGaEWuLaXvXUTpw4+dNfvhHxo5469PhYrKcwrV0l4XZxU3PPrLQe7liC8esgQ99+OCuTFI9npZtkCjAVk34Yceki2S72mEj1h+D+hpIwLGs2fquxDun31QyyVjyoICl9QSVzHUR/eBqWQB24sPLiQBMYF+Huv/gPYjBeFxxnGrcaXqYGedJWRdHpnRWolyCuZqYD44d+nJZAllsTo7dbBTzO7TpvnE6gKriWHnu04AtZZCmBxqnUtp2kGb4OX3Zn95U09glFgENOY/3Xi4hUuMWQL4XqPh2z8dx0ZO/HTaG8LKOoI413HvqXo1AtjB3bsBN5pPww0Zd2JsrC9bKJiWg53x0wsQlR0wOtvAu9/MrNSNv5/JBdSiOcXe4QHlmLKbFuLcAZ0Sa rz5jFsoL kHPs3MQ9C6H6ZMY8lm3gYxKd8Z8nUbEMFAefIrot8T2LSt6rpaapzY5AZw7/j7X4WLFKC0Lx1ueBceHzU7k4JD/U3OwuheI6rY1YfrbaaZNNJL3/1WMeDFCPFXLGAlfrTTFi+WrA5ywWIz8PMfMmaL+bKLGM9p7EFye0n68yNEb6IOxmWa0p1mXnHSYDndxwJyMZkjF13RcSPJqf9WJDfk3m3A4tenRsOGRLh 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Boot-time page size selection for arm64
|
expand
|
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 28704f924612c..c600574105c63 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -1161,7 +1161,7 @@ int nfs42_proc_clone(struct file *src_f, struct file *dst_f, return err; } -#define NFS4XATTR_MAXPAGES DIV_ROUND_UP(XATTR_SIZE_MAX, PAGE_SIZE) +#define NFS4XATTR_MAXPAGES DIV_ROUND_UP(XATTR_SIZE_MAX, PAGE_SIZE_MIN) static int _nfs42_proc_removexattr(struct inode *inode, const char *name) { diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c index b6e3d8f77b910..734177eb44889 100644 --- a/fs/nfs/nfs42xattr.c +++ b/fs/nfs/nfs42xattr.c @@ -183,7 +183,7 @@ nfs4_xattr_alloc_entry(const char *name, const void *value, uint32_t flags; BUILD_BUG_ON(sizeof(struct nfs4_xattr_entry) + - XATTR_NAME_MAX + 1 > PAGE_SIZE); + XATTR_NAME_MAX + 1 > PAGE_SIZE_MIN); alloclen = sizeof(struct nfs4_xattr_entry); if (name != NULL) { diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index b8ffbe52ba15a..3c3622f46d3e0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5928,7 +5928,7 @@ static bool nfs4_server_supports_acls(const struct nfs_server *server, * it's OK to put sizeof(void) * (XATTR_SIZE_MAX/PAGE_SIZE) bytes on * the stack. */ -#define NFS4ACL_MAXPAGES DIV_ROUND_UP(XATTR_SIZE_MAX, PAGE_SIZE) +#define NFS4ACL_MAXPAGES DIV_ROUND_UP(XATTR_SIZE_MAX, PAGE_SIZE_MIN) int nfs4_buf_to_pages_noslab(const void *buf, size_t buflen, struct page **pages)
To prepare for supporting boot-time page size selection, refactor code to remove assumptions about PAGE_SIZE being compile-time constant. Code intended to be equivalent when compile-time page size is active. Calculation of NFS4ACL_MAXPAGES and NFS4XATTR_MAXPAGES are modified to give max pages when page size is at the minimum. BUILD_BUG_ON() is modified to test against the min page size, which implicitly also applies to all other page sizes. Signed-off-by: Ryan Roberts <ryan.roberts@arm.com> --- ***NOTE*** Any confused maintainers may want to read the cover note here for context: https://lore.kernel.org/all/20241014105514.3206191-1-ryan.roberts@arm.com/ fs/nfs/nfs42proc.c | 2 +- fs/nfs/nfs42xattr.c | 2 +- fs/nfs/nfs4proc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)