diff options
| author | Yannick Vignon <[email protected]> | 2022-02-04 13:55:44 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2022-02-08 03:59:13 +0000 |
| commit | 642436a1ad34a28c45bbc2bdc131640a73782356 (patch) | |
| tree | 55e9ca887936fe33d053986f223f542d7c0cdb70 /net/switchdev/switchdev.c | |
| parent | net: typhoon: include <net/vxlan.h> (diff) | |
| download | kernel-642436a1ad34a28c45bbc2bdc131640a73782356.tar.gz kernel-642436a1ad34a28c45bbc2bdc131640a73782356.zip | |
net: stmmac: optimize locking around PTP clock reads
Reading the PTP clock is a simple operation requiring only 3 register
reads. Under a PREEMPT_RT kernel, protecting those reads by a spin_lock is
counter-productive: if the 2nd task preempting the 1st has a higher prio
but needs to read time as well, it will require 2 context switches, which
will pretty much always be more costly than just disabling preemption for
the duration of the reads. Moreover, with the code logic recently added
to get_systime(), disabling preemption is not even required anymore:
reads and writes just need to be protected from each other, to prevent a
clock read while the clock is being updated.
Improve the above situation by replacing the PTP spinlock by a rwlock, and
using read_lock for PTP clock reads so simultaneous reads do not block
each other.
Signed-off-by: Yannick Vignon <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
