* [PATCH] erofs: enable large folio in device-based mode
@ 2022-11-10 7:40 Jingbo Xu
2022-11-10 7:59 ` JeffleXu
0 siblings, 1 reply; 4+ messages in thread
From: Jingbo Xu @ 2022-11-10 7:40 UTC (permalink / raw)
To: xiang, chao, linux-erofs; +Cc: huyue2, linux-kernel
Enable large folio in device-based mode. Then the radahead routine will
pass down large folio containing multiple pages.
Enable this feature for non-compressed format for now, until the
compression part supports large folio later.
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
I have tested it under workload of Linux compiling. I know it's not a
perfect workload testing this feature, because large folio is less
likely hit in this case since source files are generally small. But I
indeed observed large folios (e.g. 16 pages) by peeking
readahead_count(rac) in erofs_readahead().
---
fs/erofs/inode.c | 2 ++
1 file changed, 2 insertions(+)
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 related [flat|nested] 4+ messages in thread
* Re: [PATCH] erofs: enable large folio in device-based mode
2022-11-10 7:40 [PATCH] erofs: enable large folio in device-based mode Jingbo Xu
@ 2022-11-10 7:59 ` JeffleXu
2022-11-11 6:36 ` Gao Xiang
0 siblings, 1 reply; 4+ messages in thread
From: JeffleXu @ 2022-11-10 7:59 UTC (permalink / raw)
To: xiang, chao, linux-erofs; +Cc: huyue2, linux-kernel
On 11/10/22 3:40 PM, Jingbo Xu wrote:
> Enable large folio in device-based mode. Then the radahead routine will
> pass down large folio containing multiple pages.
>
> Enable this feature for non-compressed format for now, until the
> compression part supports large folio later.
>
> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
> ---
> I have tested it under workload of Linux compiling. I know it's not a
> perfect workload testing this feature, because large folio is less
> likely hit in this case since source files are generally small. But I
> indeed observed large folios (e.g. 16 pages) by peeking
> readahead_count(rac) in erofs_readahead().
Sorry, readahead_count(rac) returns the whole number of pages inside the
rac, which can not prove large folio passed in.
I retired later and observed large folio (e.g. with order 2) by peeking
folio_order(ctx->cur_folio) inside iomap_readahead_iter()
> ---
> fs/erofs/inode.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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;
--
Thanks,
Jingbo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] erofs: enable large folio in device-based mode
2022-11-10 7:59 ` JeffleXu
@ 2022-11-11 6:36 ` Gao Xiang
2022-11-27 13:35 ` Gao Xiang
0 siblings, 1 reply; 4+ messages in thread
From: Gao Xiang @ 2022-11-11 6:36 UTC (permalink / raw)
To: JeffleXu; +Cc: xiang, chao, linux-erofs, huyue2, linux-kernel
Hi,
On Thu, Nov 10, 2022 at 03:59:14PM +0800, JeffleXu wrote:
>
>
> On 11/10/22 3:40 PM, Jingbo Xu wrote:
> > Enable large folio in device-based mode. Then the radahead routine will
> > pass down large folio containing multiple pages.
> >
> > Enable this feature for non-compressed format for now, until the
> > compression part supports large folio later.
> >
> > Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
> > ---
> > I have tested it under workload of Linux compiling. I know it's not a
> > perfect workload testing this feature, because large folio is less
> > likely hit in this case since source files are generally small. But I
> > indeed observed large folios (e.g. 16 pages) by peeking
> > readahead_count(rac) in erofs_readahead().
>
> Sorry, readahead_count(rac) returns the whole number of pages inside the
> rac, which can not prove large folio passed in.
>
> I retired later and observed large folio (e.g. with order 2) by peeking
> folio_order(ctx->cur_folio) inside iomap_readahead_iter()
I will test it as well after I send out all bug fixes for this cycle.
Thanks,
Gao Xiang
>
> > ---
> > fs/erofs/inode.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > 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;
>
> --
> Thanks,
> Jingbo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] erofs: enable large folio in device-based mode
2022-11-11 6:36 ` Gao Xiang
@ 2022-11-27 13:35 ` Gao Xiang
0 siblings, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2022-11-27 13:35 UTC (permalink / raw)
To: JeffleXu; +Cc: xiang, chao, linux-erofs, huyue2, linux-kernel
On Fri, Nov 11, 2022 at 02:36:25PM +0800, Gao Xiang wrote:
> Hi,
>
> On Thu, Nov 10, 2022 at 03:59:14PM +0800, JeffleXu wrote:
> >
> >
> > On 11/10/22 3:40 PM, Jingbo Xu wrote:
> > > Enable large folio in device-based mode. Then the radahead routine will
> > > pass down large folio containing multiple pages.
> > >
> > > Enable this feature for non-compressed format for now, until the
> > > compression part supports large folio later.
> > >
> > > Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
> > > ---
> > > I have tested it under workload of Linux compiling. I know it's not a
> > > perfect workload testing this feature, because large folio is less
> > > likely hit in this case since source files are generally small. But I
> > > indeed observed large folios (e.g. 16 pages) by peeking
> > > readahead_count(rac) in erofs_readahead().
> >
> > Sorry, readahead_count(rac) returns the whole number of pages inside the
> > rac, which can not prove large folio passed in.
> >
> > I retired later and observed large folio (e.g. with order 2) by peeking
> > folio_order(ctx->cur_folio) inside iomap_readahead_iter()
>
> I will test it as well after I send out all bug fixes for this cycle.
I've updated the subject and commit message as:
"
erofs: enable large folios for iomap mode
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.
"
Thanks,
Gao Xiang
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-27 13:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-10 7:40 [PATCH] erofs: enable large folio in device-based mode Jingbo Xu
2022-11-10 7:59 ` JeffleXu
2022-11-11 6:36 ` Gao Xiang
2022-11-27 13:35 ` Gao Xiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox