mm/vmscan: add a comment about MADV_FREE pages check in folio_check_dirty_writeback

Patch series "A few cleanup and fixup patches for vmscan

This series contains a few patches to remove obsolete comment, introduce
helper to remove duplicated code and so no.  Also we take all base pages
of THP into account in rare race condition.  More details can be found in
the respective changelogs.


This patch (of 6):

The MADV_FREE pages check in folio_check_dirty_writeback is a bit hard to
follow.  Add a comment to make the code clear.

Link: https://lkml.kernel.org/r/[email protected]
Suggested-by: Huang, Ying <[email protected]>
Signed-off-by: Miaohe Lin <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Oscar Salvador <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
Miaohe Lin authored and Andrew Morton committed 2022-05-13 07:20:13 -07:00
1 parent 048f6e1a42
commit 32a331a72f
1 file changed
+4 -1
+4 -1
View File
@@ -1435,7 +1435,10 @@ static void folio_check_dirty_writeback(struct folio *folio,
/*
* Anonymous pages are not handled by flushers and must be written
* from reclaim context. Do not stall reclaim based on them
* from reclaim context. Do not stall reclaim based on them.
* MADV_FREE anonymous pages are put into inactive file list too.
* 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))) {