Thread (11 messages) flat view 11 messages, 3 authors, 2021-05-18

Re: [PATCH net v8 1/3] net: sched: fix packet stuck problem for lockless qdisc

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-05-14 23:39:30
Also in: bpf, linux-can, lkml

On Fri, 14 May 2021 16:36:16 -0700 Cong Wang wrote:
quoted
@@ -176,8 +202,15 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)
 static inline void qdisc_run_end(struct Qdisc *qdisc)
 {
        write_seqcount_end(&qdisc->running);
-       if (qdisc->flags & TCQ_F_NOLOCK)
+       if (qdisc->flags & TCQ_F_NOLOCK) {
                spin_unlock(&qdisc->seqlock);
+
+               if (unlikely(test_bit(__QDISC_STATE_MISSED,
+                                     &qdisc->state))) {
+                       clear_bit(__QDISC_STATE_MISSED, &qdisc->state);  
We have test_and_clear_bit() which is atomic, test_bit()+clear_bit()
is not.
It doesn't have to be atomic, right? I asked to split the test because
test_and_clear is a locked op on x86, test by itself is not.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help