The patch titled Subject: mm: fix shrink nr.unqueued_dirty counter issue has been added to the -mm mm-unstable branch. Its filename is mm-fix-shrink-nrunqueued_dirty-counter-issue.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-fix-shrink-nrunqueued_dirty-counter-issue.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Zhiguo Jiang <justinjiang@xxxxxxxx> Subject: mm: fix shrink nr.unqueued_dirty counter issue Date: Fri, 12 Jan 2024 09:23:52 +0800 It is needed to ensure sc->nr.unqueued_dirty > 0, which can avoid setting PGDAT_DIRTY flag when sc->nr.unqueued_dirty and sc->nr.file_taken are both zero. Link: https://lkml.kernel.org/r/20240112012353.1387-1-justinjiang@xxxxxxxx Signed-off-by: Zhiguo Jiang <justinjiang@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/vmscan.c~mm-fix-shrink-nrunqueued_dirty-counter-issue +++ a/mm/vmscan.c @@ -5984,7 +5984,8 @@ again: set_bit(PGDAT_WRITEBACK, &pgdat->flags); /* Allow kswapd to start writing pages during reclaim.*/ - if (sc->nr.unqueued_dirty == sc->nr.file_taken) + if (sc->nr.unqueued_dirty && + sc->nr.unqueued_dirty == sc->nr.file_taken) set_bit(PGDAT_DIRTY, &pgdat->flags); /* _ Patches currently in -mm which might be from justinjiang@xxxxxxxx are mm-fix-shrink-nrunqueued_dirty-counter-issue.patch