Skip to content

Commit 704f06e

Browse files
committed
LoongArch: Allow to enable PREEMPT_LAZY
LoongArch has supported PREEMPT_RT now. It uses GENERIC_ENTRY, so just add the TIF bit (TIF_NEED_RESCHED_LAZY) related definitions and select the Kconfig symbol (ARCH_HAS_PREEMPT_LAZY) is enough to make it go. Signed-off-by: Xi Ruoyao <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent be2ea98 commit 704f06e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ config LOONGARCH
2323
select ARCH_HAS_KERNEL_FPU_SUPPORT if CPU_HAS_FPU
2424
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
2525
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
26+
select ARCH_HAS_PREEMPT_LAZY
2627
select ARCH_HAS_PTE_DEVMAP
2728
select ARCH_HAS_PTE_SPECIAL
2829
select ARCH_HAS_SET_MEMORY

arch/loongarch/include/asm/thread_info.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ register unsigned long current_stack_pointer __asm__("$sp");
6666
* - pending work-to-be-done flags are in LSW
6767
* - other flags in MSW
6868
*/
69-
#define TIF_SIGPENDING 1 /* signal pending */
70-
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
69+
#define TIF_NEED_RESCHED 0 /* rescheduling necessary */
70+
#define TIF_NEED_RESCHED_LAZY 1 /* lazy rescheduling necessary */
71+
#define TIF_SIGPENDING 2 /* signal pending */
7172
#define TIF_NOTIFY_RESUME 3 /* callback before returning to user */
7273
#define TIF_NOTIFY_SIGNAL 4 /* signal notifications exist */
7374
#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
@@ -88,8 +89,9 @@ register unsigned long current_stack_pointer __asm__("$sp");
8889
#define TIF_LBT_CTX_LIVE 20 /* LBT context must be preserved */
8990
#define TIF_PATCH_PENDING 21 /* pending live patching update */
9091

91-
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
9292
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
93+
#define _TIF_NEED_RESCHED_LAZY (1<<TIF_NEED_RESCHED_LAZY)
94+
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
9395
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
9496
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
9597
#define _TIF_NOHZ (1<<TIF_NOHZ)

0 commit comments

Comments
 (0)