From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,phillip@squashfs.org.uk,akpm@linux-foundation.org
Subject: + squashfs-dont-allocate-read_page-cache-if-squashfs_file_direct-configured.patch added to mm-nonmm-unstable branch
Date: Mon, 30 Dec 2024 16:32:29 -0800 [thread overview]
Message-ID: <20241231003230.4645BC4CED0@smtp.kernel.org> (raw)
The patch titled
Subject: squashfs: don't allocate read_page cache if SQUASHFS_FILE_DIRECT configured
has been added to the -mm mm-nonmm-unstable branch. Its filename is
squashfs-dont-allocate-read_page-cache-if-squashfs_file_direct-configured.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/squashfs-dont-allocate-read_page-cache-if-squashfs_file_direct-configured.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Phillip Lougher <phillip@squashfs.org.uk>
Subject: squashfs: don't allocate read_page cache if SQUASHFS_FILE_DIRECT configured
Date: Sun, 29 Dec 2024 23:37:50 +0000
If Squashfs has been configured to directly read datablocks into the page
cache (SQUASHFS_FILE_DIRECT), then the read_page cache is unnecessary.
This improvement is due to the following two commits, which added the
ability to read datablocks into the page cache when pages were missing,
enabling the fallback which used an intermediate buffer to be removed.
commit f268eedddf359 ("squashfs: extend "page actor" to handle missing pages")
commit 1bb1a07afad97 ("squashfs: don't use intermediate buffer if pages missing")
This reduces the amount of memory used when mounting a filesystem by
block_size * maximum number of threads.
Link: https://lkml.kernel.org/r/20241229233752.54481-3-phillip@squashfs.org.uk
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/squashfs/squashfs.h | 6 ++++++
fs/squashfs/super.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
--- a/fs/squashfs/squashfs.h~squashfs-dont-allocate-read_page-cache-if-squashfs_file_direct-configured
+++ a/fs/squashfs/squashfs.h
@@ -14,6 +14,12 @@
#define WARNING(s, args...) pr_warn("SQUASHFS: "s, ## args)
+#ifdef CONFIG_SQUASHFS_FILE_CACHE
+#define SQUASHFS_READ_PAGES msblk->max_thread_num
+#else
+#define SQUASHFS_READ_PAGES 0
+#endif
+
/* block.c */
extern int squashfs_read_data(struct super_block *, u64, int, u64 *,
struct squashfs_page_actor *);
--- a/fs/squashfs/super.c~squashfs-dont-allocate-read_page-cache-if-squashfs_file_direct-configured
+++ a/fs/squashfs/super.c
@@ -323,7 +323,7 @@ static int squashfs_fill_super(struct su
/* Allocate read_page block */
msblk->read_page = squashfs_cache_init("data",
- msblk->max_thread_num, msblk->block_size);
+ SQUASHFS_READ_PAGES, msblk->block_size);
if (IS_ERR(msblk->read_page)) {
errorf(fc, "Failed to allocate read_page block");
err = PTR_ERR(msblk->read_page);
_
Patches currently in -mm which might be from phillip@squashfs.org.uk are
squashfs-make-squashfs_cache_init-return-err_ptr-enomem.patch
squashfs-dont-allocate-read_page-cache-if-squashfs_file_direct-configured.patch
documentation-update-the-squashfs-filesystem-documentation.patch
squashfs-update-kconfig-information.patch
reply other threads:[~2024-12-31 0:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241231003230.4645BC4CED0@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=mm-commits@vger.kernel.org \
--cc=phillip@squashfs.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.