From 2c01c7c12f1524fe9adba07b87ca090044328107 Mon Sep 17 00:00:00 2001 From: Juhyung Park Date: Sun, 3 Jul 2022 03:12:23 +0900 Subject: [PATCH] mm: compaction: expose proactive compaction counter Signed-off-by: Juhyung Park Signed-off-by: UtsavBalar1231 --- mm/compaction.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 34fe67abad07..d7be7dcfa31a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2858,6 +2858,9 @@ void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx) wake_up_interruptible(&pgdat->kcompactd_wait); } +static unsigned int proactively_compacted; +module_param(proactively_compacted, uint, 0644); + /* * The background compaction daemon, started as a kernel thread * from the init process. @@ -2925,6 +2928,8 @@ static int kcompactd(void *p) if (unlikely(score >= prev_score)) timeout = default_timeout << COMPACT_MAX_DEFER_SHIFT; + else + proactively_compacted++; } if (unlikely(pgdat->proactive_compact_trigger)) pgdat->proactive_compact_trigger = false;