From 6778948f9de86c3cfaf36725a7c87dcff9ba247f Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 08:20:59 +0000 Subject: [PATCH] kernel_5.10 no rt --- kernel/include/linux/interrupt.h | 34 ++++++++++++++-------------------- 1 files changed, 14 insertions(+), 20 deletions(-) diff --git a/kernel/include/linux/interrupt.h b/kernel/include/linux/interrupt.h index d21f7af..386ddf4 100644 --- a/kernel/include/linux/interrupt.h +++ b/kernel/include/linux/interrupt.h @@ -566,7 +566,7 @@ asmlinkage void do_softirq(void); asmlinkage void __do_softirq(void); -#if defined(__ARCH_HAS_DO_SOFTIRQ) && !defined(CONFIG_PREEMPT_RT) +#ifdef __ARCH_HAS_DO_SOFTIRQ void do_softirq_own_stack(void); #else static inline void do_softirq_own_stack(void) @@ -661,21 +661,26 @@ TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ }; -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) +#ifdef CONFIG_SMP static inline int tasklet_trylock(struct tasklet_struct *t) { return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); } -void tasklet_unlock(struct tasklet_struct *t); -void tasklet_unlock_wait(struct tasklet_struct *t); -void tasklet_unlock_spin_wait(struct tasklet_struct *t); +static inline void tasklet_unlock(struct tasklet_struct *t) +{ + smp_mb__before_atomic(); + clear_bit(TASKLET_STATE_RUN, &(t)->state); +} +static inline void tasklet_unlock_wait(struct tasklet_struct *t) +{ + while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } +} #else -static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } -static inline void tasklet_unlock(struct tasklet_struct *t) { } -static inline void tasklet_unlock_wait(struct tasklet_struct *t) { } -static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) { } +#define tasklet_trylock(t) 1 +#define tasklet_unlock_wait(t) do { } while (0) +#define tasklet_unlock(t) do { } while (0) #endif extern void __tasklet_schedule(struct tasklet_struct *t); @@ -698,17 +703,6 @@ { atomic_inc(&t->count); smp_mb__after_atomic(); -} - -/* - * Do not use in new code. Disabling tasklets from atomic contexts is - * error prone and should be avoided. - */ -static inline void tasklet_disable_in_atomic(struct tasklet_struct *t) -{ - tasklet_disable_nosync(t); - tasklet_unlock_spin_wait(t); - smp_mb(); } static inline void tasklet_disable(struct tasklet_struct *t) -- Gitblit v1.6.2