]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/sched.h
sched: Add is_idle_task() to handle invalidated uses of idle_cpu()
[mirror_ubuntu-artful-kernel.git] / include / linux / sched.h
index 1c4f3e9b9bc50e52ea57623f5b886691fb52db14..4a7e4d333a275c3a475df99761a45d1a6e158a55 100644 (file)
@@ -2070,6 +2070,14 @@ extern int sched_setscheduler(struct task_struct *, int,
 extern int sched_setscheduler_nocheck(struct task_struct *, int,
                                      const struct sched_param *);
 extern struct task_struct *idle_task(int cpu);
+/**
+ * is_idle_task - is the specified task an idle task?
+ * @tsk: the task in question.
+ */
+static inline bool is_idle_task(struct task_struct *p)
+{
+       return p->pid == 0;
+}
 extern struct task_struct *curr_task(int cpu);
 extern void set_curr_task(int cpu, struct task_struct *p);