Skip to content

Commit bc3309c

Browse files
author
Fox Snowpatch
committed
1 parent ad0be02 commit bc3309c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

arch/powerpc/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ config PPC
145145
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
146146
select ARCH_HAS_PHYS_TO_DMA
147147
select ARCH_HAS_PMEM_API
148+
select ARCH_HAS_PREEMPT_LAZY
148149
select ARCH_HAS_PTE_DEVMAP if PPC_BOOK3S_64
149150
select ARCH_HAS_PTE_SPECIAL
150151
select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64

arch/powerpc/include/asm/thread_info.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ void arch_setup_new_exec(void);
103103
#define TIF_PATCH_PENDING 6 /* pending live patching update */
104104
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
105105
#define TIF_SINGLESTEP 8 /* singlestepping active */
106+
#define TIF_NEED_RESCHED_LAZY 9 /* Scheduler driven lazy preemption */
106107
#define TIF_SECCOMP 10 /* secure computing */
107108
#define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */
108109
#define TIF_NOERROR 12 /* Force successful syscall return */
@@ -122,6 +123,7 @@ void arch_setup_new_exec(void);
122123
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
123124
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
124125
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
126+
#define _TIF_NEED_RESCHED_LAZY (1<<TIF_NEED_RESCHED_LAZY)
125127
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
126128
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
127129
#define _TIF_32BIT (1<<TIF_32BIT)
@@ -142,9 +144,10 @@ void arch_setup_new_exec(void);
142144
_TIF_SYSCALL_EMU)
143145

144146
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
145-
_TIF_NOTIFY_RESUME | _TIF_UPROBE | \
146-
_TIF_RESTORE_TM | _TIF_PATCH_PENDING | \
147-
_TIF_NOTIFY_SIGNAL)
147+
_TIF_NEED_RESCHED_LAZY | _TIF_NOTIFY_RESUME | \
148+
_TIF_UPROBE | _TIF_RESTORE_TM | \
149+
_TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL)
150+
148151
#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)
149152

150153
/* Bits in local_flags */

arch/powerpc/kernel/interrupt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ interrupt_exit_user_prepare_main(unsigned long ret, struct pt_regs *regs)
185185
ti_flags = read_thread_flags();
186186
while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
187187
local_irq_enable();
188-
if (ti_flags & _TIF_NEED_RESCHED) {
188+
if (ti_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) {
189189
schedule();
190190
} else {
191191
/*
@@ -396,7 +396,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
396396
/* Returning to a kernel context with local irqs enabled. */
397397
WARN_ON_ONCE(!(regs->msr & MSR_EE));
398398
again:
399-
if (IS_ENABLED(CONFIG_PREEMPT)) {
399+
if (IS_ENABLED(CONFIG_PREEMPTION)) {
400400
/* Return to preemptible kernel context */
401401
if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
402402
if (preempt_count() == 0)

arch/powerpc/lib/vmx-helper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int exit_vmx_usercopy(void)
4545
* set and we are preemptible. The hack here is to schedule a
4646
* decrementer to fire here and reschedule for us if necessary.
4747
*/
48-
if (IS_ENABLED(CONFIG_PREEMPT) && need_resched())
48+
if (IS_ENABLED(CONFIG_PREEMPTION) && need_resched())
4949
set_dec(1);
5050
return 0;
5151
}

0 commit comments

Comments
 (0)