Skip to content

Commit e080a26

Browse files
committed
erofs: allow large folios for compressed files
As commit 2e6506e ("mm/migrate: fix deadlock in migrate_pages_batch() on large folios") has landed upstream, large folios can be safely enabled for compressed inodes since all prerequisites have already landed in 6.11-rc1. Stress tests has been running on my fleet for over 20 days without any regression. Additionally, users [1] have requested it for months. Let's allow large folios for EROFS full cases upstream now for wider testing. [1] https://lore.kernel.org/r/CAGsJ_4wtE8OcpinuqVwG4jtdx6Qh5f+TON6wz+4HMCq=A2qFcA@mail.gmail.com Cc: Barry Song <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> [ Gao Xiang: minor commit typo fixes. ] Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2c53462 commit e080a26

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Documentation/filesystems/erofs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Here are the main features of EROFS:
7575

7676
- Support merging tail-end data into a special inode as fragments.
7777

78-
- Support large folios for uncompressed files.
78+
- Support large folios to make use of THPs (Transparent Hugepages);
7979

8080
- Support direct I/O on uncompressed files to avoid double caching for loop
8181
devices;

fs/erofs/inode.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,25 +257,23 @@ static int erofs_fill_inode(struct inode *inode)
257257
goto out_unlock;
258258
}
259259

260+
mapping_set_large_folios(inode->i_mapping);
260261
if (erofs_inode_is_data_compressed(vi->datalayout)) {
261262
#ifdef CONFIG_EROFS_FS_ZIP
262263
DO_ONCE_LITE_IF(inode->i_blkbits != PAGE_SHIFT,
263264
erofs_info, inode->i_sb,
264265
"EXPERIMENTAL EROFS subpage compressed block support in use. Use at your own risk!");
265266
inode->i_mapping->a_ops = &z_erofs_aops;
266-
err = 0;
267-
goto out_unlock;
268-
#endif
267+
#else
269268
err = -EOPNOTSUPP;
270-
goto out_unlock;
271-
}
272-
inode->i_mapping->a_ops = &erofs_raw_access_aops;
273-
mapping_set_large_folios(inode->i_mapping);
269+
#endif
270+
} else {
271+
inode->i_mapping->a_ops = &erofs_raw_access_aops;
274272
#ifdef CONFIG_EROFS_FS_ONDEMAND
275-
if (erofs_is_fscache_mode(inode->i_sb))
276-
inode->i_mapping->a_ops = &erofs_fscache_access_aops;
273+
if (erofs_is_fscache_mode(inode->i_sb))
274+
inode->i_mapping->a_ops = &erofs_fscache_access_aops;
277275
#endif
278-
276+
}
279277
out_unlock:
280278
erofs_put_metabuf(&buf);
281279
return err;

0 commit comments

Comments
 (0)