hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/arch/x86/entry/entry_32.S
....@@ -750,8 +750,25 @@
750750 ENTRY(resume_kernel)
751751 DISABLE_INTERRUPTS(CLBR_ANY)
752752 .Lneed_resched:
753
+ # preempt count == 0 + NEED_RS set?
753754 cmpl $0, PER_CPU_VAR(__preempt_count)
755
+#ifndef CONFIG_PREEMPT_LAZY
754756 jnz restore_all_kernel
757
+#else
758
+ jz test_int_off
759
+
760
+ # atleast preempt count == 0 ?
761
+ cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count)
762
+ jne restore_all_kernel
763
+
764
+ movl PER_CPU_VAR(current_task), %ebp
765
+ cmpl $0,TASK_TI_preempt_lazy_count(%ebp) # non-zero preempt_lazy_count ?
766
+ jnz restore_all_kernel
767
+
768
+ testl $_TIF_NEED_RESCHED_LAZY, TASK_TI_flags(%ebp)
769
+ jz restore_all_kernel
770
+test_int_off:
771
+#endif
755772 testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ?
756773 jz restore_all_kernel
757774 call preempt_schedule_irq