hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/interrupt.h
....@@ -566,7 +566,7 @@
566566 asmlinkage void do_softirq(void);
567567 asmlinkage void __do_softirq(void);
568568
569
-#if defined(__ARCH_HAS_DO_SOFTIRQ) && !defined(CONFIG_PREEMPT_RT)
569
+#ifdef __ARCH_HAS_DO_SOFTIRQ
570570 void do_softirq_own_stack(void);
571571 #else
572572 static inline void do_softirq_own_stack(void)
....@@ -661,21 +661,26 @@
661661 TASKLET_STATE_RUN /* Tasklet is running (SMP only) */
662662 };
663663
664
-#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)
664
+#ifdef CONFIG_SMP
665665 static inline int tasklet_trylock(struct tasklet_struct *t)
666666 {
667667 return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state);
668668 }
669669
670
-void tasklet_unlock(struct tasklet_struct *t);
671
-void tasklet_unlock_wait(struct tasklet_struct *t);
672
-void tasklet_unlock_spin_wait(struct tasklet_struct *t);
670
+static inline void tasklet_unlock(struct tasklet_struct *t)
671
+{
672
+ smp_mb__before_atomic();
673
+ clear_bit(TASKLET_STATE_RUN, &(t)->state);
674
+}
673675
676
+static inline void tasklet_unlock_wait(struct tasklet_struct *t)
677
+{
678
+ while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
679
+}
674680 #else
675
-static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; }
676
-static inline void tasklet_unlock(struct tasklet_struct *t) { }
677
-static inline void tasklet_unlock_wait(struct tasklet_struct *t) { }
678
-static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) { }
681
+#define tasklet_trylock(t) 1
682
+#define tasklet_unlock_wait(t) do { } while (0)
683
+#define tasklet_unlock(t) do { } while (0)
679684 #endif
680685
681686 extern void __tasklet_schedule(struct tasklet_struct *t);
....@@ -698,17 +703,6 @@
698703 {
699704 atomic_inc(&t->count);
700705 smp_mb__after_atomic();
701
-}
702
-
703
-/*
704
- * Do not use in new code. Disabling tasklets from atomic contexts is
705
- * error prone and should be avoided.
706
- */
707
-static inline void tasklet_disable_in_atomic(struct tasklet_struct *t)
708
-{
709
- tasklet_disable_nosync(t);
710
- tasklet_unlock_spin_wait(t);
711
- smp_mb();
712706 }
713707
714708 static inline void tasklet_disable(struct tasklet_struct *t)