hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/arch/x86/entry/entry_64.S
....@@ -733,7 +733,23 @@
733733 btl $9, EFLAGS(%rsp) /* were interrupts off? */
734734 jnc 1f
735735 0: cmpl $0, PER_CPU_VAR(__preempt_count)
736
+#ifndef CONFIG_PREEMPT_LAZY
736737 jnz 1f
738
+#else
739
+ jz do_preempt_schedule_irq
740
+
741
+ # atleast preempt count == 0 ?
742
+ cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count)
743
+ jnz 1f
744
+
745
+ movq PER_CPU_VAR(current_task), %rcx
746
+ cmpl $0, TASK_TI_preempt_lazy_count(%rcx)
747
+ jnz 1f
748
+
749
+ btl $TIF_NEED_RESCHED_LAZY,TASK_TI_flags(%rcx)
750
+ jnc 1f
751
+do_preempt_schedule_irq:
752
+#endif
737753 call preempt_schedule_irq
738754 jmp 0b
739755 1:
....@@ -1084,6 +1100,7 @@
10841100 jmp 2b
10851101 .previous
10861102
1103
+#ifndef CONFIG_PREEMPT_RT_FULL
10871104 /* Call softirq on interrupt stack. Interrupts are off. */
10881105 ENTRY(do_softirq_own_stack)
10891106 pushq %rbp
....@@ -1094,6 +1111,7 @@
10941111 leaveq
10951112 ret
10961113 ENDPROC(do_softirq_own_stack)
1114
+#endif
10971115
10981116 #ifdef CONFIG_XEN
10991117 idtentry hypervisor_callback xen_do_hypervisor_callback has_error_code=0