net: extend net_device allocation to vmalloc()
authorEric Dumazet <[email protected]>
Wed, 30 Oct 2013 20:10:44 +0000 (13:10 -0700)
committerDavid S. Miller <[email protected]>
Mon, 4 Nov 2013 04:19:00 +0000 (23:19 -0500)
commit74d332c13b2148ae934ea94dac1745ae92efe8e5
tree4f8f287774deaba28fa4c85d085d587ae7515aaf
parentb397f99921827e114d7f5600447e172a99c50165
net: extend net_device allocation to vmalloc()

Joby Poriyath provided a xen-netback patch to reduce the size of
xenvif structure as some netdev allocation could fail under
memory pressure/fragmentation.

This patch is handling the problem at the core level, allowing
any netdev structures to use vmalloc() if kmalloc() failed.

As vmalloc() adds overhead on a critical network path, add __GFP_REPEAT
to kzalloc() flags to do this fallback only when really needed.

Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: Joby Poriyath <[email protected]>
Cc: Ben Hutchings <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Documentation/networking/netdevices.txt
include/linux/netdevice.h
net/core/dev.c
net/core/net-sysfs.c