.. | .. |
---|
56 | 56 | struct thread_info { |
---|
57 | 57 | unsigned long flags; /* low level flags */ |
---|
58 | 58 | u32 status; /* thread synchronous flags */ |
---|
| 59 | + int preempt_lazy_count; /* 0 => lazy preemptable |
---|
| 60 | + <0 => BUG */ |
---|
59 | 61 | }; |
---|
60 | 62 | |
---|
61 | 63 | #define INIT_THREAD_INFO(tsk) \ |
---|
62 | 64 | { \ |
---|
63 | 65 | .flags = 0, \ |
---|
| 66 | + .preempt_lazy_count = 0, \ |
---|
64 | 67 | } |
---|
65 | 68 | |
---|
66 | 69 | #else /* !__ASSEMBLY__ */ |
---|
67 | 70 | |
---|
68 | 71 | #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 ; |
---|
69 | 76 | |
---|
70 | 77 | #endif |
---|
71 | 78 | |
---|
.. | .. |
---|
91 | 98 | #define TIF_NOCPUID 15 /* CPUID is not accessible in userland */ |
---|
92 | 99 | #define TIF_NOTSC 16 /* TSC is not accessible in userland */ |
---|
93 | 100 | #define TIF_IA32 17 /* IA32 compatibility process */ |
---|
| 101 | +#define TIF_NEED_RESCHED_LAZY 18 /* lazy rescheduling necessary */ |
---|
94 | 102 | #define TIF_NOHZ 19 /* in adaptive nohz mode */ |
---|
95 | 103 | #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ |
---|
96 | 104 | #define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */ |
---|
.. | .. |
---|
120 | 128 | #define _TIF_NOCPUID (1 << TIF_NOCPUID) |
---|
121 | 129 | #define _TIF_NOTSC (1 << TIF_NOTSC) |
---|
122 | 130 | #define _TIF_IA32 (1 << TIF_IA32) |
---|
| 131 | +#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) |
---|
123 | 132 | #define _TIF_NOHZ (1 << TIF_NOHZ) |
---|
124 | 133 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
---|
125 | 134 | #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) |
---|
.. | .. |
---|
165 | 174 | #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) |
---|
166 | 175 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) |
---|
167 | 176 | |
---|
| 177 | +#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) |
---|
| 178 | + |
---|
168 | 179 | #define STACK_WARN (THREAD_SIZE/8) |
---|
169 | 180 | |
---|
170 | 181 | /* |
---|