erofs: enable dax for chunk based regular file
PATCH 1/1 erofs: enable dax for chunk based regular file
DAX can be used to share page cache between VMs, reducing guest memory overhead. And chunk based data format is widely used for VM and container image. So enable dax support for it, make erofs better used for VM scenarios.
--- fs/erofs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/erofs/inode.c +2 -1
@@ -183,7 +183,8 @@ static void *erofs_read_inode(struct erofs_buf *buf, inode->i_flags &= ~S_DAX ;if (test_opt (&sbi->opt,DAX_ALWAYS ) &&S_ISREG (inode->i_mode) && - vi->datalayout ==EROFS_INODE_FLAT_PLAIN ) + (vi->datalayout ==EROFS_INODE_FLAT_PLAIN || + vi->datalayout ==EROFS_INODE_CHUNK_BASED )) inode->i_flags |=S_DAX ;if (!nblks)
Signature · 1 line
2.25.1
Hi Xin,
Quoted 6 lines · Xin Yin
DAX can be used to share page cache between VMs, reducing guest memory overhead. And chunk based data format is widely used for VM and container image. So enable dax support for it, make erofs better used for VM scenarios.
Signed-off-by Xin Yin <[email protected]>
I really think it's a regression honestly, how about updating the subject line to:
"erofs: fix fsdax unavailability for chunk-based regular files"
Thanks,
Gao Xiang
Quoted 9 lines · Gao Xiang
Hi Xin,
Quoted 5 lines · Xin Yin
DAX can be used to share page cache between VMs, reducing guest memory overhead. And chunk based data format is widely used for VM and container image. So enable dax support for it, make erofs better used for VM scenarios.
Quoted 9 lines
Quoted 1 line
Signed-off-by Xin Yin <[email protected]>I really think it's a regression honestly, how about updating the subject line to:
"erofs: fix fsdax unavailability for chunk-based regular files"
Fixes c5aa903a59db ("erofs: support reading chunk-based uncompressed files")
OK , I will update and resend the new patch.
Thanks,
Xin Yin
Quoted 2 lines
Thanks,
Gao Xiang