summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-21 22:28:15 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-01 20:09:54 +0200
commit28b24f90020fed8e8e3e8e20575f08c1cd06e54f (patch)
tree3fc7b7bd080580d56131a0a3b46468b1b1eea6f2 /net/sched
parentnet: lockless implementation of SO_BUSY_POLL, SO_PREFER_BUSY_POLL, SO_BUSY_PO... (diff)
downloadlinux-28b24f90020fed8e8e3e8e20575f08c1cd06e54f.tar.xz
linux-28b24f90020fed8e8e3e8e20575f08c1cd06e54f.zip
net: implement lockless SO_MAX_PACING_RATE
SO_MAX_PACING_RATE setsockopt() does not need to hold the socket lock, because sk->sk_pacing_rate readers can run fine if the value is changed by other threads, after adding READ_ONCE() accessors. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_fq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 681bbf34b707..d35419db7b94 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -668,7 +668,7 @@ begin:
*/
if (!skb->tstamp) {
if (skb->sk)
- rate = min(skb->sk->sk_pacing_rate, rate);
+ rate = min(READ_ONCE(skb->sk->sk_pacing_rate), rate);
if (rate <= q->low_rate_threshold) {
f->credit = 0;