summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorZhiguo Jiang <justinjiang@vivo.com>2024-01-12 02:23:52 +0100
committerAndrew Morton <akpm@linux-foundation.org>2024-11-06 01:56:24 +0100
commitbbc251f30ef312343fec3f5c0591ce01078c2bb9 (patch)
tree99c883ccee62c6e154536743afc3d8b2611442ba /mm/vmscan.c
parentmaple_tree: memset maple_big_node as a whole (diff)
downloadlinux-bbc251f30ef312343fec3f5c0591ce01078c2bb9.tar.xz
linux-bbc251f30ef312343fec3f5c0591ce01078c2bb9.zip
mm: fix shrink nr.unqueued_dirty counter issue
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@vivo.com Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 28ba2b06fc7d..20dd72c98813 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -5990,7 +5990,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);
/*