]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tcp: use this_cpu_read(*X) instead of *this_cpu_ptr(X)
authorEric Dumazet <edumazet@google.com>
Sat, 1 Jun 2019 02:17:33 +0000 (19:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2019 22:09:34 +0000 (15:09 -0700)
this_cpu_read(*X) is slightly faster than *this_cpu_ptr(X)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c

index af81e4a6a8d8eac9aad551a129384ff6b1bf2f6c..59b7edd8719c33d747169b7ae97e4cb3d5e7bcb4 100644 (file)
@@ -771,7 +771,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
        arg.tos = ip_hdr(skb)->tos;
        arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL);
        local_bh_disable();
-       ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk);
+       ctl_sk = this_cpu_read(*net->ipv4.tcp_sk);
        if (sk)
                ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?
                                   inet_twsk(sk)->tw_mark : sk->sk_mark;
@@ -863,7 +863,7 @@ static void tcp_v4_send_ack(const struct sock *sk,
        arg.tos = tos;
        arg.uid = sock_net_uid(net, sk_fullsock(sk) ? sk : NULL);
        local_bh_disable();
-       ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk);
+       ctl_sk = this_cpu_read(*net->ipv4.tcp_sk);
        if (sk)
                ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?
                                   inet_twsk(sk)->tw_mark : sk->sk_mark;