diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1f07040d28e3..b867a4dab38a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1903,8 +1903,6 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
1903 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1903 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1904 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1904 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
1905 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ | 1905 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ |
1906 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | ||
1907 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ | ||
1908 | #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */ | 1906 | #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */ |
1909 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | 1907 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ |
1910 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1908 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
@@ -1957,17 +1955,31 @@ static inline void memalloc_noio_restore(unsigned int flags) | |||
1957 | } | 1955 | } |
1958 | 1956 | ||
1959 | /* Per-process atomic flags. */ | 1957 | /* Per-process atomic flags. */ |
1960 | #define PFA_NO_NEW_PRIVS 0x00000001 /* May not gain new privileges. */ | 1958 | #define PFA_NO_NEW_PRIVS 0 /* May not gain new privileges. */ |
1961 | 1959 | #define PFA_SPREAD_PAGE 1 /* Spread page cache over cpuset */ | |
1962 | static inline bool task_no_new_privs(struct task_struct *p) | 1960 | #define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */ |
1963 | { | 1961 | |
1964 | return test_bit(PFA_NO_NEW_PRIVS, &p->atomic_flags); | 1962 | |
1965 | } | 1963 | #define TASK_PFA_TEST(name, func) \ |
1966 | 1964 | static inline bool task_##func(struct task_struct *p) \ | |
1967 | static inline void task_set_no_new_privs(struct task_struct *p) | 1965 | { return test_bit(PFA_##name, &p->atomic_flags); } |
1968 | { | 1966 | #define TASK_PFA_SET(name, func) \ |
1969 | set_bit(PFA_NO_NEW_PRIVS, &p->atomic_flags); | 1967 | static inline void task_set_##func(struct task_struct *p) \ |
1970 | } | 1968 | { set_bit(PFA_##name, &p->atomic_flags); } |
1969 | #define TASK_PFA_CLEAR(name, func) \ | ||
1970 | static inline void task_clear_##func(struct task_struct *p) \ | ||
1971 | { clear_bit(PFA_##name, &p->atomic_flags); } | ||
1972 | |||
1973 | TASK_PFA_TEST(NO_NEW_PRIVS, no_new_privs) | ||
1974 | TASK_PFA_SET(NO_NEW_PRIVS, no_new_privs) | ||
1975 | |||
1976 | TASK_PFA_TEST(SPREAD_PAGE, spread_page) | ||
1977 | TASK_PFA_SET(SPREAD_PAGE, spread_page) | ||
1978 | TASK_PFA_CLEAR(SPREAD_PAGE, spread_page) | ||
1979 | |||
1980 | TASK_PFA_TEST(SPREAD_SLAB, spread_slab) | ||
1981 | TASK_PFA_SET(SPREAD_SLAB, spread_slab) | ||
1982 | TASK_PFA_CLEAR(SPREAD_SLAB, spread_slab) | ||
1971 | 1983 | ||
1972 | /* | 1984 | /* |
1973 | * task->jobctl flags | 1985 | * task->jobctl flags |