All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: use this_cpu_read() in rt6_get_pcpu_route()
@ 2019-06-01  1:11 Eric Dumazet
  2019-06-03 22:06 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2019-06-01  1:11 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet

this_cpu_read(*X) is faster than *this_cpu_ptr(X)

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/route.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index fada5a13bcb2a286bb20a350c1873b1b16dc866a..a72d01010cb6a734b2c4ee2dd865390d88e6a3b2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1268,10 +1268,9 @@ static struct rt6_info *ip6_rt_pcpu_alloc(const struct fib6_result *res)
 /* It should be called with rcu_read_lock() acquired */
 static struct rt6_info *rt6_get_pcpu_route(const struct fib6_result *res)
 {
-	struct rt6_info *pcpu_rt, **p;
+	struct rt6_info *pcpu_rt;
 
-	p = this_cpu_ptr(res->nh->rt6i_pcpu);
-	pcpu_rt = *p;
+	pcpu_rt = this_cpu_read(*res->nh->rt6i_pcpu);
 
 	if (pcpu_rt)
 		ip6_hold_safe(NULL, &pcpu_rt);
-- 
2.22.0.rc1.257.g3120a18244-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ipv6: use this_cpu_read() in rt6_get_pcpu_route()
  2019-06-01  1:11 [PATCH net-next] ipv6: use this_cpu_read() in rt6_get_pcpu_route() Eric Dumazet
@ 2019-06-03 22:06 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-03 22:06 UTC (permalink / raw)
  To: edumazet; +Cc: netdev, eric.dumazet

From: Eric Dumazet <edumazet@google.com>
Date: Fri, 31 May 2019 18:11:25 -0700

> this_cpu_read(*X) is faster than *this_cpu_ptr(X)
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-03 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-01  1:11 [PATCH net-next] ipv6: use this_cpu_read() in rt6_get_pcpu_route() Eric Dumazet
2019-06-03 22:06 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.