Merge branch 'remove-qdisc-running-counter'
authorDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 11:54:41 +0000 (12:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 11:54:41 +0000 (12:54 +0100)
commitf8ba22a14268b432f685fd8463a958a3594b7fb6
tree6feb3ee12123611d1988813e9e139c4c81280aec
parent254ec036db1123b10e23e1412c191a3cf70dce71
parent29cbcd85828372333aa87542c51f2b2b0fd4380c
Merge branch 'remove-qdisc-running-counter'

Sebastian Andrzej Siewior says:

====================
Try to simplify the gnet_stats and remove qdisc->running sequence counter.

The first few patches is a follow up to
    https://lore.kernel.org/all/20211007175000.2334713-1-bigeasy@linutronix.de/

The remaining patches (#5+) remove the seqcount_t (Qdisc::running) from
the Qdisc. The statistics (Qdisc::bstats and Qdisc::cpu_bstats) use
u64_stats_t and the "running state" is now represented by a bit in
Qdisc::state.

By removing the seqcount_t from Qdisc and decoupling the bstats
statistics from the seqcount_t it is possible to query the statistics
even if the Qdisc is running instead of waiting until it is idle again.

The try-lock like usage of the seqcount_t in qdisc_run_begin() is
problematic on PREEMPT_RT. Inside the qdisc_run_begin/end() qdisc->running
sequence counter write sections, at sch_direct_xmit(), the seqcount write
serialization lock is released then re-acquired. This is fine for !RT, because
the writer is in a BH disabled region and there is a no in-IRQ reader. For RT
though, BH sections are preemptible. The earlier introduced seqcount_LOCKNAME_t
mechanism, which for RT the reader acquires then relesaes the write
serailization lock to avoid infinite spinning if it preempts a seqcount write
section, cannot work: the qdisc->running write serialization lock is already
intermittingly released inside the seqcount write section.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>