diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2021-10-19 12:12:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-19 13:07:35 +0100 |
commit | e22db7bd552f7f7f19fe4ef60abfb7e7b364e3a8 (patch) | |
tree | 71470e97aab9eb973799c15ee5b9516983ac3ffc /net/core/gen_stats.c | |
parent | dc90604b5836998bb2911faf80dc204f35db08a0 (diff) | |
download | linux-e22db7bd552f7f7f19fe4ef60abfb7e7b364e3a8.tar.bz2 |
net: sched: Allow statistics reads from softirq.
Eric reported that the rate estimator reads statics from the softirq
which in turn triggers a warning introduced in the statistics rework.
The warning is too cautious. The updates happen in the softirq context
so reads from softirq are fine since the writes can not be preempted.
The updates/writes happen during qdisc_run() which ensures one writer
and the softirq context.
The remaining bad context for reading statistics remains in hard-IRQ
because it may preempt a writer.
Fixes: 29cbcd8582837 ("net: sched: Remove Qdisc::running sequence counter")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/gen_stats.c')
-rw-r--r-- | net/core/gen_stats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c index 5516ea0d5da0..15c270e22c5e 100644 --- a/net/core/gen_stats.c +++ b/net/core/gen_stats.c @@ -154,7 +154,7 @@ void gnet_stats_add_basic(struct gnet_stats_basic_sync *bstats, u64 bytes = 0; u64 packets = 0; - WARN_ON_ONCE((cpu || running) && !in_task()); + WARN_ON_ONCE((cpu || running) && in_hardirq()); if (cpu) { gnet_stats_add_basic_cpu(bstats, cpu); |