diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h index a0bcd1260b8..24014e71cda 100644 --- a/sys/compat/linuxkpi/common/include/linux/sched.h +++ b/sys/compat/linuxkpi/common/include/linux/sched.h @@ -130,7 +130,8 @@ put_task_struct(struct task_struct *task) #define yield() kern_yield(PRI_UNCHANGED) #define sched_yield() sched_relinquish(curthread) -#define need_resched() td_ast_pending(curthread, TDA_SCHED) +#define need_resched() (curthread->td_owepreempt || \ + td_ast_pending(curthread, TDA_SCHED)) static inline int cond_resched_lock(spinlock_t *lock)