commit 8557cf226032d0ac1d751896c7d7fefdc10de8bc Author: Corcodel Marian Date: Sun Jul 3 11:31:12 2016 +0300 Prevent run mwait_idle_with_hints funct on resched process. Is not good ideea to run mwait_idle_with_hints when resched is running.Most of embedded functions check for non existence of rescheduling process. diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h index 0deeb2d..d8d0633 100644 --- a/arch/x86/include/asm/mwait.h +++ b/arch/x86/include/asm/mwait.h @@ -97,6 +97,9 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx) */ static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) { + if (need_resched()) { + return; + } if (!current_set_polling_and_test()) { if (static_cpu_has_bug(X86_BUG_CLFLUSH_MONITOR)) { mb(); @@ -105,8 +108,7 @@ static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) } __monitor((void *)¤t_thread_info()->flags, 0, 0); - if (!need_resched()) - __mwait(eax, ecx); + __mwait(eax, ecx); } current_clr_polling(); }