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 --- mm/vmscan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7de11524a936..9d4745ad5e23 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -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; -- 2.50.0