Skip to content

Commit 22aaec3

Browse files
xhackerustcPeter Zijlstra
authored andcommitted
riscv: add PREEMPT_LAZY support
riscv has switched to GENERIC_ENTRY, so adding PREEMPT_LAZY is as simple as adding TIF_NEED_RESCHED_LAZY related definitions and enabling ARCH_HAS_PREEMPT_LAZY. [bigeasy: Replace old PREEMPT_AUTO bits with new PREEMPT_LAZY ] Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 476e858 commit 22aaec3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ config RISCV
3939
select ARCH_HAS_MMIOWB
4040
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
4141
select ARCH_HAS_PMEM_API
42+
select ARCH_HAS_PREEMPT_LAZY
4243
select ARCH_HAS_PREPARE_SYNC_CORE_CMD
4344
select ARCH_HAS_PTE_DEVMAP if 64BIT && MMU
4445
select ARCH_HAS_PTE_SPECIAL

arch/riscv/include/asm/thread_info.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,21 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
107107
* - pending work-to-be-done flags are in lowest half-word
108108
* - other flags in upper half-word(s)
109109
*/
110-
#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
111-
#define TIF_SIGPENDING 2 /* signal pending */
112-
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
110+
#define TIF_NEED_RESCHED 0 /* rescheduling necessary */
111+
#define TIF_NEED_RESCHED_LAZY 1 /* Lazy rescheduling needed */
112+
#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
113+
#define TIF_SIGPENDING 3 /* signal pending */
113114
#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
114115
#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
115116
#define TIF_NOTIFY_SIGNAL 9 /* signal notifications exist */
116117
#define TIF_UPROBE 10 /* uprobe breakpoint or singlestep */
117118
#define TIF_32BIT 11 /* compat-mode 32bit process */
118119
#define TIF_RISCV_V_DEFER_RESTORE 12 /* restore Vector before returing to user */
119120

121+
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
122+
#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
120123
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
121124
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
122-
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
123125
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
124126
#define _TIF_UPROBE (1 << TIF_UPROBE)
125127
#define _TIF_RISCV_V_DEFER_RESTORE (1 << TIF_RISCV_V_DEFER_RESTORE)

0 commit comments

Comments
 (0)