psi: pressure stall information for CPU, memory, and IO
[platform/kernel/linux-starfive.git] / mm / compaction.c
index faca45e..7c60747 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/kthread.h>
 #include <linux/freezer.h>
 #include <linux/page_owner.h>
+#include <linux/psi.h>
 #include "internal.h"
 
 #ifdef CONFIG_COMPACTION
@@ -2068,11 +2069,15 @@ static int kcompactd(void *p)
        pgdat->kcompactd_classzone_idx = pgdat->nr_zones - 1;
 
        while (!kthread_should_stop()) {
+               unsigned long pflags;
+
                trace_mm_compaction_kcompactd_sleep(pgdat->node_id);
                wait_event_freezable(pgdat->kcompactd_wait,
                                kcompactd_work_requested(pgdat));
 
+               psi_memstall_enter(&pflags);
                kcompactd_do_work(pgdat);
+               psi_memstall_leave(&pflags);
        }
 
        return 0;