mm: compaction: expose proactive compaction counter

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
Juhyung Park 2022-07-03 03:12:23 +09:00 committed by spakkkk
parent 6a97d3f5c9
commit 2c01c7c12f

View File

@ -2858,6 +2858,9 @@ void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx)
wake_up_interruptible(&pgdat->kcompactd_wait); 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 * The background compaction daemon, started as a kernel thread
* from the init process. * from the init process.
@ -2925,6 +2928,8 @@ static int kcompactd(void *p)
if (unlikely(score >= prev_score)) if (unlikely(score >= prev_score))
timeout = timeout =
default_timeout << COMPACT_MAX_DEFER_SHIFT; default_timeout << COMPACT_MAX_DEFER_SHIFT;
else
proactively_compacted++;
} }
if (unlikely(pgdat->proactive_compact_trigger)) if (unlikely(pgdat->proactive_compact_trigger))
pgdat->proactive_compact_trigger = false; pgdat->proactive_compact_trigger = false;