summaryrefslogtreecommitdiff
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-06-09 17:45:11 +0300
committerDavid S. Miller <davem@davemloft.net>2016-06-09 23:28:37 +0300
commit52fbb2907988aa0583c6d9d53a56aee090b2df7e (patch)
treed15d8d64e2160d72224285158cac6e1e8b343b04 /include/net/sch_generic.h
parent5362855aba7159aab8f7c6573eb675d9da317914 (diff)
downloadlinux-52fbb2907988aa0583c6d9d53a56aee090b2df7e.tar.xz
net: sched: fix qdisc->running lockdep annotations
1) qdisc_run_begin() is really using the equivalent of a trylock. Instead of using write_seqcount_begin(), use a combination of raw_write_seqcount_begin() and correct lockdep annotation. 2) sch_direct_xmit() should use regular spin_lock(root_lock) Fixes: f9eb8aea2a1e ("net_sched: transform qdisc running bit into a seqcount") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 49534e28824b..a4c0f1649e2b 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -97,7 +97,11 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)
{
if (qdisc_is_running(qdisc))
return false;
- write_seqcount_begin(&qdisc->running);
+ /* Variant of write_seqcount_begin() telling lockdep a trylock
+ * was attempted.
+ */
+ raw_write_seqcount_begin(&qdisc->running);
+ seqcount_acquire(&qdisc->running.dep_map, 0, 1, _RET_IP_);
return true;
}