* [PATCH v2] erofs: enable large folios for iomap mode
@ 2022-11-30 6:04 Jingbo Xu
2022-11-30 6:07 ` Jingbo Xu
2022-12-06 14:06 ` Chao Yu
0 siblings, 2 replies; 3+ messages in thread
From: Jingbo Xu @ 2022-11-30 6:04 UTC (permalink / raw)
To: xiang, chao, linux-erofs; +Cc: linux-kernel
Enable large folios for iomap mode. Then the readahead routine will
pass down large folios containing multiple pages.
Let's enable this for non-compressed format for now, until the
compression part supports large folios later.
When large folios supported, the iomap routine will allocate iomap_page
for each large folio and thus we need iomap_release_folio() and
iomap_invalidate_folio() to free iomap_page when these folios get
recalimed or invalidated.
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
v2:
- add calling for iomap_release_folio() and iomap_invalidate_folio() to
support large folios
v1: https://lore.kernel.org/all/20221110074023.8059-1-jefflexu@linux.alibaba.com/
---
fs/erofs/data.c | 2 ++
fs/erofs/inode.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index fe8ac0e163f7..c9526c627dda 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -403,6 +403,8 @@ const struct address_space_operations erofs_raw_access_aops = {
.readahead = erofs_readahead,
.bmap = erofs_bmap,
.direct_IO = noop_direct_IO,
+ .release_folio = iomap_release_folio,
+ .invalidate_folio = iomap_invalidate_folio,
};
#ifdef CONFIG_FS_DAX
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index ad2a82f2eb4c..e457b8a59ee7 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -295,6 +295,8 @@ static int erofs_fill_inode(struct inode *inode)
goto out_unlock;
}
inode->i_mapping->a_ops = &erofs_raw_access_aops;
+ if (!erofs_is_fscache_mode(inode->i_sb))
+ mapping_set_large_folios(inode->i_mapping);
#ifdef CONFIG_EROFS_FS_ONDEMAND
if (erofs_is_fscache_mode(inode->i_sb))
inode->i_mapping->a_ops = &erofs_fscache_access_aops;
--
2.19.1.6.gb485710b
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] erofs: enable large folios for iomap mode
2022-11-30 6:04 [PATCH v2] erofs: enable large folios for iomap mode Jingbo Xu
@ 2022-11-30 6:07 ` Jingbo Xu
2022-12-06 14:06 ` Chao Yu
1 sibling, 0 replies; 3+ messages in thread
From: Jingbo Xu @ 2022-11-30 6:07 UTC (permalink / raw)
To: xiang, chao, linux-erofs; +Cc: linux-kernel
On 11/30/22 2:04 PM, Jingbo Xu wrote:
> Enable large folios for iomap mode. Then the readahead routine will
> pass down large folios containing multiple pages.
>
> Let's enable this for non-compressed format for now, until the
> compression part supports large folios later.
>
> When large folios supported, the iomap routine will allocate iomap_page
> for each large folio and thus we need iomap_release_folio() and
> iomap_invalidate_folio() to free iomap_page when these folios get
> recalimed or invalidated. ^
reclaimed
--
Thanks,
Jingbo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] erofs: enable large folios for iomap mode
2022-11-30 6:04 [PATCH v2] erofs: enable large folios for iomap mode Jingbo Xu
2022-11-30 6:07 ` Jingbo Xu
@ 2022-12-06 14:06 ` Chao Yu
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2022-12-06 14:06 UTC (permalink / raw)
To: Jingbo Xu, xiang, linux-erofs; +Cc: linux-kernel
On 2022/11/30 14:04, Jingbo Xu wrote:
> Enable large folios for iomap mode. Then the readahead routine will
> pass down large folios containing multiple pages.
>
> Let's enable this for non-compressed format for now, until the
> compression part supports large folios later.
>
> When large folios supported, the iomap routine will allocate iomap_page
> for each large folio and thus we need iomap_release_folio() and
> iomap_invalidate_folio() to free iomap_page when these folios get
> recalimed or invalidated.
>
> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-06 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 6:04 [PATCH v2] erofs: enable large folios for iomap mode Jingbo Xu
2022-11-30 6:07 ` Jingbo Xu
2022-12-06 14:06 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®