All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch net] addrconf: reduce unnecessary atomic allocations
@ 2018-08-22 19:58 Cong Wang
  2018-08-22 20:09 ` David Ahern
  2018-08-23  4:42 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Cong Wang @ 2018-08-22 19:58 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, David Ahern

All the 3 callers of addrconf_add_mroute() assert RTNL
lock, they don't take any additional lock either, so
it is safe to convert it to GFP_KERNEL.

Same for sit_add_v4_addrs().

Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/ipv6/addrconf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 2fac4ad74867..d51a8c0b3372 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2398,7 +2398,7 @@ static void addrconf_add_mroute(struct net_device *dev)
 
 	ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0);
 
-	ip6_route_add(&cfg, GFP_ATOMIC, NULL);
+	ip6_route_add(&cfg, GFP_KERNEL, NULL);
 }
 
 static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
@@ -3062,7 +3062,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
 	if (addr.s6_addr32[3]) {
 		add_addr(idev, &addr, plen, scope);
 		addrconf_prefix_route(&addr, plen, 0, idev->dev, 0, pflags,
-				      GFP_ATOMIC);
+				      GFP_KERNEL);
 		return;
 	}
 
@@ -3087,7 +3087,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
 
 				add_addr(idev, &addr, plen, flag);
 				addrconf_prefix_route(&addr, plen, 0, idev->dev,
-						      0, pflags, GFP_ATOMIC);
+						      0, pflags, GFP_KERNEL);
 			}
 		}
 	}
-- 
2.14.4

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

* Re: [Patch net] addrconf: reduce unnecessary atomic allocations
  2018-08-22 19:58 [Patch net] addrconf: reduce unnecessary atomic allocations Cong Wang
@ 2018-08-22 20:09 ` David Ahern
  2018-08-23  4:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2018-08-22 20:09 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David Ahern

On 8/22/18 1:58 PM, Cong Wang wrote:
> All the 3 callers of addrconf_add_mroute() assert RTNL
> lock, they don't take any additional lock either, so
> it is safe to convert it to GFP_KERNEL.
> 
> Same for sit_add_v4_addrs().
> 
> Cc: David Ahern <dsahern@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
>  net/ipv6/addrconf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Not sure how I missed the double ASSERT_RTNL() check for
sit_add_v4_addrs. Thanks for following up.

Reviewed-by: David Ahern <dsahern@gmail.com>

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

* Re: [Patch net] addrconf: reduce unnecessary atomic allocations
  2018-08-22 19:58 [Patch net] addrconf: reduce unnecessary atomic allocations Cong Wang
  2018-08-22 20:09 ` David Ahern
@ 2018-08-23  4:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-23  4:42 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, dsahern

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed, 22 Aug 2018 12:58:34 -0700

> All the 3 callers of addrconf_add_mroute() assert RTNL
> lock, they don't take any additional lock either, so
> it is safe to convert it to GFP_KERNEL.
> 
> Same for sit_add_v4_addrs().
> 
> Cc: David Ahern <dsahern@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

end of thread, other threads:[~2018-08-23  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 19:58 [Patch net] addrconf: reduce unnecessary atomic allocations Cong Wang
2018-08-22 20:09 ` David Ahern
2018-08-23  4:42 ` 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.