FROMLIST: refactor header includes to allow kthread.h inclusion in psi_types.h
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / include / linux / sched.h
index 44b54d6488387eee5b1dc369891c97c5074f21b8..e99ac4d74444cbe2aec0aeba71e088195b81a7f2 100644 (file)
@@ -416,6 +416,19 @@ struct sched_avg {
        struct util_est                 util_est;
 };
 
+struct ontime_avg {
+       u64 ontime_migration_time;
+       u64 load_sum;
+       u32 period_contrib;
+       unsigned long load_avg;
+};
+
+struct ontime_entity {
+       struct ontime_avg avg;
+       int migrating;
+       int cpu;
+};
+
 struct sched_statistics {
 #ifdef CONFIG_SCHEDSTATS
        u64                             wait_start;
@@ -486,6 +499,7 @@ struct sched_entity {
         */
        struct sched_avg                avg ____cacheline_aligned_in_smp;
 #endif
+       struct ontime_entity            ontime;
 };
 
 #ifdef CONFIG_SCHED_WALT
@@ -539,6 +553,19 @@ struct sched_rt_entity {
        /* rq "owned" by this entity/group: */
        struct rt_rq                    *my_q;
 #endif
+
+#ifdef CONFIG_SMP
+#ifdef CONFIG_SCHED_USE_FLUID_RT
+       int sync_flag;
+#endif
+       /*
+        * Per entity load average tracking.
+        *
+        * Put into separate cache line so it does not
+        * collide with read-mostly values above.
+        */
+       struct sched_avg                avg;// ____cacheline_aligned_in_smp;
+#endif
 } __randomize_layout;
 
 struct sched_dl_entity {
@@ -684,6 +711,14 @@ struct task_struct {
        u32 init_load_pct;
        u64 last_sleep_ts;
 #endif
+#ifdef CONFIG_SCHED_USE_FLUID_RT
+       int victim_flag;
+#endif
+
+#ifdef CONFIG_SCHED_EMS
+       struct task_band *band;
+       struct list_head band_members;
+#endif
 
 #ifdef CONFIG_CGROUP_SCHED
        struct task_group               *sched_task_group;
@@ -751,6 +786,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;
 
@@ -1013,6 +1052,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;
@@ -1442,6 +1485,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 */
@@ -1494,6 +1538,7 @@ static inline bool is_percpu_thread(void)
 #define PFA_SPEC_SSB_FORCE_DISABLE     4       /* Speculative Store Bypass force disabled*/
 #define PFA_SPEC_IB_DISABLE            5       /* Indirect branch speculation restricted */
 #define PFA_SPEC_IB_FORCE_DISABLE      6       /* Indirect branch speculation permanently restricted */
+#define PFA_LMK_WAITING                        7       /* Lowmemorykiller is waiting */
 
 #define TASK_PFA_TEST(name, func)                                      \
        static inline bool task_##func(struct task_struct *p)           \
@@ -1532,6 +1577,9 @@ TASK_PFA_CLEAR(SPEC_IB_DISABLE, spec_ib_disable)
 TASK_PFA_TEST(SPEC_IB_FORCE_DISABLE, spec_ib_force_disable)
 TASK_PFA_SET(SPEC_IB_FORCE_DISABLE, spec_ib_force_disable)
 
+TASK_PFA_TEST(LMK_WAITING, lmk_waiting)
+TASK_PFA_SET(LMK_WAITING, lmk_waiting)
+
 static inline void
 current_restore_flags(unsigned long orig_flags, unsigned long flags)
 {