Skip to content

Commit e500c6d

Browse files
congwangdavem330
authored andcommitted
addrconf: reduce unnecessary atomic allocations
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> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 191672c commit e500c6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/ipv6/addrconf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,7 @@ static void addrconf_add_mroute(struct net_device *dev)
23982398

23992399
ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0);
24002400

2401-
ip6_route_add(&cfg, GFP_ATOMIC, NULL);
2401+
ip6_route_add(&cfg, GFP_KERNEL, NULL);
24022402
}
24032403

24042404
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)
30623062
if (addr.s6_addr32[3]) {
30633063
add_addr(idev, &addr, plen, scope);
30643064
addrconf_prefix_route(&addr, plen, 0, idev->dev, 0, pflags,
3065-
GFP_ATOMIC);
3065+
GFP_KERNEL);
30663066
return;
30673067
}
30683068

@@ -3087,7 +3087,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
30873087

30883088
add_addr(idev, &addr, plen, flag);
30893089
addrconf_prefix_route(&addr, plen, 0, idev->dev,
3090-
0, pflags, GFP_ATOMIC);
3090+
0, pflags, GFP_KERNEL);
30913091
}
30923092
}
30933093
}

0 commit comments

Comments
 (0)