mm/vmscan: remove redundant folio_test_swapbacked()
Subsystems (3)
PATCH 1/1 mm/vmscan: remove redundant folio_test_swapbacked()
When !folio_is_file_lru(folio) is false, it implies that !folio_test_swapbacked(folio) must be true. Therefore, the additional check for !folio_test_swapbacked(folio) is redundant and can be safely removed.
This cleanup simplifies the code without changing any functionality.
--- mm/vmscan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
mm/vmscan.c +1 -2
@@ -985,8 +985,7 @@ static void folio_check_dirty_writeback(struct folio *folio,* They could be mistakenly treated as file lru. So further anon * test is needed. */ -if (!folio_is_file_lru (folio) || - (folio_test_anon (folio) && !folio_test_swapbacked (folio))) { +if (!folio_is_file_lru (folio) ||folio_test_anon (folio)) { *dirty = false; *writeback = false;return ;
Signature · 1 line
2.50.0
Quoted 28 lines · Jialin Wang
When !folio_is_file_lru(folio) is false, it implies that !folio_test_swapbacked(folio) must be true. Therefore, the additional check for !folio_test_swapbacked(folio) is redundant and can be safely removed.
This cleanup simplifies the code without changing any functionality.
Signed-off-by Jialin Wang <[email protected]>--- mm/vmscan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)mm/vmscan.c +1
-3@@ -985,8 +985,7 @@ static void folio_check_dirty_writeback(struct folio *folio,* They could be mistakenly treated as file lru. So further anon * test is needed. */ -if (!folio_is_file_lru (folio) || - (folio_test_anon (folio) && !folio_test_swapbacked (folio))) { +if (!folio_is_file_lru (folio) ||folio_test_anon (folio)) { *dirty = false; *writeback = false;return ; --
Quoted 2 lines
2.50.0
My apologies for sending this patch to the wrong mailing list and missing proper cc's. Please disregard this patch as I've now resent it correctly.
https://lore.kernel.org/linux-mm/[email protected]/
Thank you for your understanding, and sorry for the noise.
Best regards,
Jialin Wang