aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking/netdevices.txt
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-10-30 16:10:44 -0400
committerDavid S. Miller <davem@davemloft.net>2013-11-03 23:19:00 -0500
commit74d332c13b2148ae934ea94dac1745ae92efe8e5 (patch)
tree4f8f287774deaba28fa4c85d085d587ae7515aaf /Documentation/networking/netdevices.txt
parentb397f99921827e114d7f5600447e172a99c50165 (diff)
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 <edumazet@google.com> Reported-by: Joby Poriyath <joby.poriyath@citrix.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking/netdevices.txt')
-rw-r--r--Documentation/networking/netdevices.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index c7ecc7080494..0b1cf6b2a592 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -10,12 +10,12 @@ network devices.
10struct net_device allocation rules 10struct net_device allocation rules
11================================== 11==================================
12Network device structures need to persist even after module is unloaded and 12Network device structures need to persist even after module is unloaded and
13must be allocated with kmalloc. If device has registered successfully, 13must be allocated with alloc_netdev_mqs() and friends.
14it will be freed on last use by free_netdev. This is required to handle the 14If device has registered successfully, it will be freed on last use
15pathologic case cleanly (example: rmmod mydriver </sys/class/net/myeth/mtu ) 15by free_netdev(). This is required to handle the pathologic case cleanly
16(example: rmmod mydriver </sys/class/net/myeth/mtu )
16 17
17There are routines in net_init.c to handle the common cases of 18alloc_netdev_mqs()/alloc_netdev() reserve extra space for driver
18alloc_etherdev, alloc_netdev. These reserve extra space for driver
19private data which gets freed when the network device is freed. If 19private data which gets freed when the network device is freed. If
20separately allocated data is attached to the network device 20separately allocated data is attached to the network device
21(netdev_priv(dev)) then it is up to the module exit handler to free that. 21(netdev_priv(dev)) then it is up to the module exit handler to free that.