Skip to contentSkip to conversation

f2fs: remove mappedtodisk flag usage in mmap write path

PATCH New Nanzhe Zhao via Linux-f2fs-devel 1 participant 1 message Sep 21 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: remove mappedtodisk flag usage in mmap write path

PG_mappedtodisk was inherited from the nobh/buffer-head era. However, f2fs has no buffer heads and the flag is no longer meaningful. The only user of the flag is the "no holes" shortcut in f2fs_vm_page_mkwrite(), which makes mmap write faults skip:

- zeroing the post-EOF part of the faulted folio,
- marking the folio dirty (mm dirties shared file mappings after ->page_mkwrite() returns, so this one was not noticeable),
- APP_MAPPED_IO iostat and REQ_TIME updates.

Remove this shortcut in f2fs_vm_page_mkwrite() and stop setting it in f2fs_read_single_page().

---
 fs/f2fs/data.c | 1 -
 fs/f2fs/file.c | 6 ------
 2 files changed, 7 deletions(-)
fs/f2fs/data.c +0 -1
index a3b02c067e89..14cea508ae01 100644
@@ -2264,7 +2264,6 @@ static int f2fs_read_single_page(struct inode *inode, struct fsverity_info *vi,
 got_it:
 	if ((map->m_flags & F2FS_MAP_MAPPED)) {
 		block_nr = map->m_pblk + block_in_file - map->m_lblk;
-		folio_set_mappedtodisk(folio);
 
 		if (!f2fs_is_valid_blkaddr(F2FS_I_SB(inode), block_nr,
 						DATA_GENERIC_ENHANCE_READ)) {
fs/f2fs/file.c +0 -6
index b0bdc7a977b9..5fc491c0a69d 100644
@@ -218,12 +218,6 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
 	/* wait for GCed page writeback via META_MAPPING */
 	f2fs_wait_on_block_writeback(inode, dn.data_blkaddr);
 
-	/*
-	 * check to see if the page is mapped already (no holes)
-	 */
-	if (folio_test_mappedtodisk(folio))
-		goto out_sem;
-
 	/* page is wholly or partially inside EOF */
 	if (((loff_t)(folio->index + 1) << PAGE_SHIFT) >
 						i_size_read(inode)) {
Signature · 8 lines
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel