Skip to content

Commit

Permalink
addrconf: reduce unnecessary atomic allocations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cong Wang authored and David S. Miller committed Aug 23, 2018
1 parent 191672c commit e500c6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit e500c6d

Please sign in to comment.