UPSTREAM: psi: pressure stall information for CPU, memory, and IO
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / include / linux / sched.h
index 9cefc9f646b24221ebe4e61485d1070c88ddc589..5d91de63a1078c4f501304aed08bb148c340a886 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/latencytop.h>
 #include <linux/sched/prio.h>
 #include <linux/signal_types.h>
+#include <linux/psi_types.h>
 #include <linux/mm_types_task.h>
 #include <linux/task_io_accounting.h>
 
@@ -786,6 +787,10 @@ struct task_struct {
        unsigned                        sched_contributes_to_load:1;
        unsigned                        sched_migrated:1;
        unsigned                        sched_remote_wakeup:1;
+#ifdef CONFIG_PSI
+       unsigned                        sched_psi_wake_requeue:1;
+#endif
+
        /* Force alignment to the next boundary: */
        unsigned                        :0;
 
@@ -1048,6 +1053,10 @@ struct task_struct {
        siginfo_t                       *last_siginfo;
 
        struct task_io_accounting       ioac;
+#ifdef CONFIG_PSI
+       /* Pressure stall state */
+       unsigned int                    psi_flags;
+#endif
 #ifdef CONFIG_TASK_XACCT
        /* Accumulated RSS usage: */
        u64                             acct_rss_mem1;
@@ -1477,6 +1486,7 @@ extern struct pid *cad_pid;
 #define PF_KTHREAD             0x00200000      /* I am a kernel thread */
 #define PF_RANDOMIZE           0x00400000      /* Randomize virtual address space */
 #define PF_SWAPWRITE           0x00800000      /* Allowed to write to swap */
+#define PF_MEMSTALL            0x01000000      /* Stalled due to lack of memory */
 #define PF_NO_SETAFFINITY      0x04000000      /* Userland is not allowed to meddle with cpus_allowed */
 #define PF_MCE_EARLY           0x08000000      /* Early kill for mce process policy */
 #define PF_MUTEX_TESTER                0x20000000      /* Thread belongs to the rt mutex tester */