.. | .. |
---|
10 | 10 | #include <linux/percpu.h> |
---|
11 | 11 | #include <linux/dynamic_queue_limits.h> |
---|
12 | 12 | #include <linux/list.h> |
---|
13 | | -#include <net/net_seq_lock.h> |
---|
14 | 13 | #include <linux/refcount.h> |
---|
15 | 14 | #include <linux/workqueue.h> |
---|
16 | 15 | #include <linux/mutex.h> |
---|
.. | .. |
---|
103 | 102 | struct sk_buff_head gso_skb ____cacheline_aligned_in_smp; |
---|
104 | 103 | struct qdisc_skb_head q; |
---|
105 | 104 | struct gnet_stats_basic_packed bstats; |
---|
106 | | - net_seqlock_t running; |
---|
| 105 | + seqcount_t running; |
---|
107 | 106 | struct gnet_stats_queue qstats; |
---|
108 | 107 | unsigned long state; |
---|
109 | 108 | struct Qdisc *next_sched; |
---|
.. | .. |
---|
146 | 145 | { |
---|
147 | 146 | if (qdisc->flags & TCQ_F_NOLOCK) |
---|
148 | 147 | return spin_is_locked(&qdisc->seqlock); |
---|
149 | | -#ifdef CONFIG_PREEMPT_RT |
---|
150 | | - return spin_is_locked(&qdisc->running.lock) ? true : false; |
---|
151 | | -#else |
---|
152 | 148 | return (raw_read_seqcount(&qdisc->running) & 1) ? true : false; |
---|
153 | | -#endif |
---|
154 | 149 | } |
---|
155 | 150 | |
---|
156 | 151 | static inline bool qdisc_is_percpu_stats(const struct Qdisc *q) |
---|
.. | .. |
---|
191 | 186 | } else if (qdisc_is_running(qdisc)) { |
---|
192 | 187 | return false; |
---|
193 | 188 | } |
---|
194 | | -#ifdef CONFIG_PREEMPT_RT |
---|
195 | | - if (spin_trylock(&qdisc->running.lock)) { |
---|
196 | | - seqcount_t *s = &qdisc->running.seqcount.seqcount; |
---|
197 | | - /* |
---|
198 | | - * Variant of write_seqcount_t_begin() telling lockdep that a |
---|
199 | | - * trylock was attempted. |
---|
200 | | - */ |
---|
201 | | - raw_write_seqcount_t_begin(s); |
---|
202 | | - seqcount_acquire(&s->dep_map, 0, 1, _RET_IP_); |
---|
203 | | - return true; |
---|
204 | | - } |
---|
205 | | - return false; |
---|
206 | | -#else |
---|
207 | 189 | /* Variant of write_seqcount_begin() telling lockdep a trylock |
---|
208 | 190 | * was attempted. |
---|
209 | 191 | */ |
---|
210 | 192 | raw_write_seqcount_begin(&qdisc->running); |
---|
211 | 193 | seqcount_acquire(&qdisc->running.dep_map, 0, 1, _RET_IP_); |
---|
212 | 194 | return true; |
---|
213 | | -#endif |
---|
214 | 195 | } |
---|
215 | 196 | |
---|
216 | 197 | static inline void qdisc_run_end(struct Qdisc *qdisc) |
---|
217 | 198 | { |
---|
218 | | -#ifdef CONFIG_PREEMPT_RT |
---|
219 | | - write_sequnlock(&qdisc->running); |
---|
220 | | -#else |
---|
221 | 199 | write_seqcount_end(&qdisc->running); |
---|
222 | | -#endif |
---|
223 | 200 | if (qdisc->flags & TCQ_F_NOLOCK) { |
---|
224 | 201 | spin_unlock(&qdisc->seqlock); |
---|
225 | 202 | |
---|
.. | .. |
---|
611 | 588 | return qdisc_lock(root); |
---|
612 | 589 | } |
---|
613 | 590 | |
---|
614 | | -static inline net_seqlock_t *qdisc_root_sleeping_running(const struct Qdisc *qdisc) |
---|
| 591 | +static inline seqcount_t *qdisc_root_sleeping_running(const struct Qdisc *qdisc) |
---|
615 | 592 | { |
---|
616 | 593 | struct Qdisc *root = qdisc_root_sleeping(qdisc); |
---|
617 | 594 | |
---|