From patchwork Tue Dec 30 20:51:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1114 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767127954; bh=xocHhyJT8Sotq4cDiBZ3l8jmobMY38KTDXNlZA2O8NM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ooJtlajsrbuolan8oRKHoYWn6iNQPdo9QpWiw6NvycMWGdfuk2w+W+qnGN1C9d+NR 2dPgQq7l5af7FPePfjW2MQj4prSjJ9gPUDlJwFZXmWHZ1c2fmwvksJWZJMIkQLFWCU r9wYIdcHnANtBAROfPsUYNHbRH2yrvO4Oc2MLn9PkMdwmEtZlRV4Rj6DLo0w6gC6D3 Zv1bLU7Uk1uaJ9SVq/7WFftQ2yxW785K1PuM2nlL6IZxbKjSFfE1GTrKyNxNA8ZXGX TO+eY0HtogZAuNh+csyF8KU17JhGBxM3uAph3iX/wz+UThlWgTcVmHo/9JVxvU/+P7 i7OZrMwY2Vo/A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 75E4A68F80 for ; Tue, 30 Dec 2025 13:52:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hkjtIuwgbP3e for ; Tue, 30 Dec 2025 13:52:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767127954; bh=xocHhyJT8Sotq4cDiBZ3l8jmobMY38KTDXNlZA2O8NM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ooJtlajsrbuolan8oRKHoYWn6iNQPdo9QpWiw6NvycMWGdfuk2w+W+qnGN1C9d+NR 2dPgQq7l5af7FPePfjW2MQj4prSjJ9gPUDlJwFZXmWHZ1c2fmwvksJWZJMIkQLFWCU r9wYIdcHnANtBAROfPsUYNHbRH2yrvO4Oc2MLn9PkMdwmEtZlRV4Rj6DLo0w6gC6D3 Zv1bLU7Uk1uaJ9SVq/7WFftQ2yxW785K1PuM2nlL6IZxbKjSFfE1GTrKyNxNA8ZXGX TO+eY0HtogZAuNh+csyF8KU17JhGBxM3uAph3iX/wz+UThlWgTcVmHo/9JVxvU/+P7 i7OZrMwY2Vo/A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 65B0368F7D for ; Tue, 30 Dec 2025 13:52:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767127953; bh=sSUBVVY3RgV5XU8QFYbC0/qVVQOj+s7OLBmXngpifqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ROAtrWA2lBSt4XRdpqEC64i4wlI94sNLoKASXUT1PGGRbjHHUKmN17GSgH43t5CZC sdaMJr6hr7U5LFbP5alAyrYzt0rlMwDs8waFrF3QXCotUiwDG0K8G7G3AwVU+RGiV/ WyF4Dfrt035xnHgMjiYeYtA0xlJqUpDbTe6y2vuFQvZqR8hGpxtYesD6p72Zbj1xtJ kX07sgIIaD08U+te05ajv3xyiGWbowutHlfkbWGLemNJfWpS12xN1SYCVXxKAhasvC YlRN8xB+Hqgl6/Hd5G/1wzIpxQb6SR768MPePRTDdKRFfl9nnCbq/k+9A8fk5YuCRE /sc2nBspB5h0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 600EA68C13; Tue, 30 Dec 2025 13:52:33 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id WuTGRSppo0Ej; Tue, 30 Dec 2025 13:52:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767127948; bh=hbJ2CXdJ5IRQbN1KvkGgP7BRKTGkR0dagCJUPWI/KTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UY0ETUVQfo5N+DfazBdoVaZdkTmWUzZCf/Do4kLTy4o02y4fqub9GF5QirqDx2Pbo mjQZyp22OAy21RMXfUWB52XLnQFgPFuDNvGIgLF99VdVkzBEkCYtTZH43nRienqkKV a/KFx8RZ6FlwVsjWhX8SqLtcdl/TCV6rC4B8DK8a5HhhWldA3mQJAHsRtYtD8+JtDB AkzqTLjVko6cJA1s8BYk81WaZNxPJZGnjb5EHo867HXA2dDGXtFWvmOpXZNuKK0b0M IazbcmSjXo7vtp1YftZbsCC5UkbkfNO/zSDmK+2Pt06SxqWDZLmwBisSARmBBj824W YBNvyjI54HtQg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7C78368C0D; Tue, 30 Dec 2025 13:52:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 30 Dec 2025 13:51:42 -0700 Message-ID: <20251230205157.3383926-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251230205157.3383926-1-sjg@u-boot.org> References: <20251230205157.3383926-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3D52XONTPVZ7NVEBNMJYYBC656TMFZN7 X-Message-ID-Hash: 3D52XONTPVZ7NVEBNMJYYBC656TMFZN7 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/14] linux: fs: Add folio cache to address_space List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a simple folio cache array to struct address_space for U-Boot's folio management, avoiding the need for Linux's XArray/radix tree infrastructure. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- include/linux/fs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 090ee192061..0bf0d3b0379 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -50,6 +50,11 @@ struct path { /* Buffer operations are in buffer_head.h */ +#ifdef __UBOOT__ +/* Maximum number of cached folios per address_space */ +#define FOLIO_CACHE_MAX 64 +#endif + /* address_space - extended for inode.c */ struct address_space { struct inode *host; @@ -58,6 +63,11 @@ struct address_space { unsigned long writeback_index; struct list_head i_private_list; const struct address_space_operations *a_ops; +#ifdef __UBOOT__ + /* Simple folio cache for U-Boot (no XA/radix tree) */ + struct folio *folio_cache[FOLIO_CACHE_MAX]; + int folio_cache_count; +#endif }; /* block_device - minimal stub */