[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250728083952.75518-2-chizhiling@163.com>
Date: Mon, 28 Jul 2025 16:39:51 +0800
From: Chi Zhiling <chizhiling@....com>
To: willy@...radead.org,
akpm@...ux-foundation.org
Cc: linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Chi Zhiling <chizhiling@...inos.cn>
Subject: [PATCH v1 1/2] mm/filemap: Do not use is_partially_uptodate for entire folio
From: Chi Zhiling <chizhiling@...inos.cn>
When a folio is marked as non-uptodate, it means the folio contains
some non-uptodate data. Therefore, calling is_partially_uptodate()
to recheck the entire folio is redundant.
If all data in a folio is actually up-to-date but the folio lacks the
uptodate flag, it will still be treated as non-uptodate in many other
places. Thus, there should be no special case handling for filemap.
Signed-off-by: Chi Zhiling <chizhiling@...inos.cn>
---
mm/filemap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/filemap.c b/mm/filemap.c
index 0e103fc99a8e..00c30f7f7dc3 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2447,6 +2447,9 @@ static bool filemap_range_uptodate(struct address_space *mapping,
pos -= folio_pos(folio);
}
+ if (pos == 0 && count >= folio_size(folio))
+ return false;
+
return mapping->a_ops->is_partially_uptodate(folio, pos, count);
}
--
2.43.0
Powered by blists - more mailing lists