···22272227 return preempt_model_full() || preempt_model_rt();22282228}2229222922302230-/*22312231- * Does a critical section need to be broken due to another22322232- * task waiting?: (technically does not depend on CONFIG_PREEMPTION,22332233- * but a general need for low latency)22342234- */22352235-static inline int spin_needbreak(spinlock_t *lock)22362236-{22372237-#ifdef CONFIG_PREEMPTION22382238- return spin_is_contended(lock);22392239-#else22402240- return 0;22412241-#endif22422242-}22432243-22442244-/*22452245- * Check if a rwlock is contended.22462246- * Returns non-zero if there is another task waiting on the rwlock.22472247- * Returns zero if the lock is not contended or the system / underlying22482248- * rwlock implementation does not support contention detection.22492249- * Technically does not depend on CONFIG_PREEMPTION, but a general need22502250- * for low latency.22512251- */22522252-static inline int rwlock_needbreak(rwlock_t *lock)22532253-{22542254-#ifdef CONFIG_PREEMPTION22552255- return rwlock_is_contended(lock);22562256-#else22572257- return 0;22582258-#endif22592259-}22602260-22612230static __always_inline bool need_resched(void)22622231{22632232 return unlikely(tif_need_resched());
+31
include/linux/spinlock.h
···449449 return raw_spin_is_contended(&lock->rlock);450450}451451452452+/*453453+ * Does a critical section need to be broken due to another454454+ * task waiting?: (technically does not depend on CONFIG_PREEMPTION,455455+ * but a general need for low latency)456456+ */457457+static inline int spin_needbreak(spinlock_t *lock)458458+{459459+#ifdef CONFIG_PREEMPTION460460+ return spin_is_contended(lock);461461+#else462462+ return 0;463463+#endif464464+}465465+466466+/*467467+ * Check if a rwlock is contended.468468+ * Returns non-zero if there is another task waiting on the rwlock.469469+ * Returns zero if the lock is not contended or the system / underlying470470+ * rwlock implementation does not support contention detection.471471+ * Technically does not depend on CONFIG_PREEMPTION, but a general need472472+ * for low latency.473473+ */474474+static inline int rwlock_needbreak(rwlock_t *lock)475475+{476476+#ifdef CONFIG_PREEMPTION477477+ return rwlock_is_contended(lock);478478+#else479479+ return 0;480480+#endif481481+}482482+452483#define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock)453484454485#else /* !CONFIG_PREEMPT_RT */