hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/arch/x86/include/asm/thread_info.h
....@@ -56,16 +56,23 @@
5656 struct thread_info {
5757 unsigned long flags; /* low level flags */
5858 u32 status; /* thread synchronous flags */
59
+ int preempt_lazy_count; /* 0 => lazy preemptable
60
+ <0 => BUG */
5961 };
6062
6163 #define INIT_THREAD_INFO(tsk) \
6264 { \
6365 .flags = 0, \
66
+ .preempt_lazy_count = 0, \
6467 }
6568
6669 #else /* !__ASSEMBLY__ */
6770
6871 #include <asm/asm-offsets.h>
72
+
73
+#define GET_THREAD_INFO(reg) \
74
+ _ASM_MOV PER_CPU_VAR(cpu_current_top_of_stack),reg ; \
75
+ _ASM_SUB $(THREAD_SIZE),reg ;
6976
7077 #endif
7178
....@@ -91,6 +98,7 @@
9198 #define TIF_NOCPUID 15 /* CPUID is not accessible in userland */
9299 #define TIF_NOTSC 16 /* TSC is not accessible in userland */
93100 #define TIF_IA32 17 /* IA32 compatibility process */
101
+#define TIF_NEED_RESCHED_LAZY 18 /* lazy rescheduling necessary */
94102 #define TIF_NOHZ 19 /* in adaptive nohz mode */
95103 #define TIF_MEMDIE 20 /* is terminating due to OOM killer */
96104 #define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */
....@@ -120,6 +128,7 @@
120128 #define _TIF_NOCPUID (1 << TIF_NOCPUID)
121129 #define _TIF_NOTSC (1 << TIF_NOTSC)
122130 #define _TIF_IA32 (1 << TIF_IA32)
131
+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
123132 #define _TIF_NOHZ (1 << TIF_NOHZ)
124133 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
125134 #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP)
....@@ -165,6 +174,8 @@
165174 #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
166175 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
167176
177
+#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)
178
+
168179 #define STACK_WARN (THREAD_SIZE/8)
169180
170181 /*