]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
LoongArch: Allow to enable PREEMPT_LAZY
authorHuacai Chen <chenhuacai@loongson.cn>
Fri, 22 Nov 2024 07:47:53 +0000 (15:47 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 26 Nov 2024 10:06:04 +0000 (18:06 +0800)
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 <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/include/asm/thread_info.h

index d5d3679057a17cb54ec2ba68c13ac8fbd3a5dcb1..dae3a9104ca6584133d9b6a3059ee666c216d31b 100644 (file)
@@ -23,6 +23,7 @@ config LOONGARCH
        select ARCH_HAS_KERNEL_FPU_SUPPORT if CPU_HAS_FPU
        select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
        select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+       select ARCH_HAS_PREEMPT_LAZY
        select ARCH_HAS_PTE_DEVMAP
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_SET_MEMORY
index 8bf0e6f5154668e7ea477e5182d68705ab4a4f32..4f5a9441754e393f82050d309eacd5641504c4c9 100644 (file)
@@ -66,8 +66,9 @@ register unsigned long current_stack_pointer __asm__("$sp");
  * - pending work-to-be-done flags are in LSW
  * - other flags in MSW
  */
-#define TIF_SIGPENDING         1       /* signal pending */
-#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
+#define TIF_NEED_RESCHED       0       /* rescheduling necessary */
+#define TIF_NEED_RESCHED_LAZY  1       /* lazy rescheduling necessary */
+#define TIF_SIGPENDING         2       /* signal pending */
 #define TIF_NOTIFY_RESUME      3       /* callback before returning to user */
 #define TIF_NOTIFY_SIGNAL      4       /* signal notifications exist */
 #define TIF_RESTORE_SIGMASK    5       /* restore signal mask in do_signal() */
@@ -88,8 +89,9 @@ register unsigned long current_stack_pointer __asm__("$sp");
 #define TIF_LBT_CTX_LIVE       20      /* LBT context must be preserved */
 #define TIF_PATCH_PENDING      21      /* pending live patching update */
 
-#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
+#define _TIF_NEED_RESCHED_LAZY (1<<TIF_NEED_RESCHED_LAZY)
+#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
 #define _TIF_NOTIFY_RESUME     (1<<TIF_NOTIFY_RESUME)
 #define _TIF_NOTIFY_SIGNAL     (1<<TIF_NOTIFY_SIGNAL)
 #define _TIF_NOHZ              (1<<TIF_NOHZ)