diff options
author | Peter Zijlstra <peterz@infradead.org> | 2021-06-11 10:28:14 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-06-18 11:43:08 +0200 |
commit | d6c23bb3a2ad2f8f7dd46292b8bc54d27f2fb3f1 (patch) | |
tree | d555f1e520de852c69089be5b1d5fe8245ec4244 /include | |
parent | 3ba9f93b12361e005dd65fcc8072b42e3189f4f4 (diff) | |
download | lwn-d6c23bb3a2ad2f8f7dd46292b8bc54d27f2fb3f1.tar.gz lwn-d6c23bb3a2ad2f8f7dd46292b8bc54d27f2fb3f1.zip |
sched: Add get_current_state()
Remove yet another few p->state accesses.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210611082838.347475156@infradead.org
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 2cd56352dae1..395c8906f502 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -213,6 +213,8 @@ struct task_group; #endif +#define get_current_state() READ_ONCE(current->state) + /* Task command name length: */ #define TASK_COMM_LEN 16 |