Loading include/linux/sched.h +29 −0 Original line number Diff line number Diff line Loading @@ -1315,6 +1315,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_WAKE_UP_IDLE 0x01000000 /* TTWU on an idle CPU */ #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 */ Loading Loading @@ -1667,4 +1668,32 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask); #define TASK_SIZE_OF(tsk) TASK_SIZE #endif static inline u32 sched_get_wake_up_idle(struct task_struct *p) { u32 enabled = p->flags & PF_WAKE_UP_IDLE; return !!enabled; } static inline int sched_set_wake_up_idle(struct task_struct *p, int wake_up_idle) { int enable = !!wake_up_idle; if (enable) p->flags |= PF_WAKE_UP_IDLE; else p->flags &= ~PF_WAKE_UP_IDLE; return 0; } static inline void set_wake_up_idle(bool enabled) { if (enabled) current->flags |= PF_WAKE_UP_IDLE; else current->flags &= ~PF_WAKE_UP_IDLE; } #endif Loading
include/linux/sched.h +29 −0 Original line number Diff line number Diff line Loading @@ -1315,6 +1315,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_WAKE_UP_IDLE 0x01000000 /* TTWU on an idle CPU */ #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 */ Loading Loading @@ -1667,4 +1668,32 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask); #define TASK_SIZE_OF(tsk) TASK_SIZE #endif static inline u32 sched_get_wake_up_idle(struct task_struct *p) { u32 enabled = p->flags & PF_WAKE_UP_IDLE; return !!enabled; } static inline int sched_set_wake_up_idle(struct task_struct *p, int wake_up_idle) { int enable = !!wake_up_idle; if (enable) p->flags |= PF_WAKE_UP_IDLE; else p->flags &= ~PF_WAKE_UP_IDLE; return 0; } static inline void set_wake_up_idle(bool enabled) { if (enabled) current->flags |= PF_WAKE_UP_IDLE; else current->flags &= ~PF_WAKE_UP_IDLE; } #endif