ksched: fix the compilation error for the older kernel.
1. task_is_running() is not defined in older kernels.
2. READ_ONCE() is redundant as the spin acquisition has an implicit barrier.
@@ -138,10 +138,10 @@ static void ksched_next_tid(struct ksched_percpu *kp, int cpu, pid_t tid)
raw_spin_lock_irqsave(&p->pi_lock, flags);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
- already_running = p->on_cpu || READ_ONCE(p->state) == TASK_WAKING ||
+ already_running = p->on_cpu || p->state == TASK_WAKING ||
p->state == TASK_RUNNING || !try_mark_task_unparked(p);
#else
- already_running = p->on_cpu || READ_ONCE(p->__state) == TASK_WAKING ||
+ already_running = p->on_cpu || p->__state == TASK_WAKING ||
task_is_running(p) || !try_mark_task_unparked(p);
#endif
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
