]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vhost-net: extend device allocation to vmalloc
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 23 Jan 2013 20:46:47 +0000 (21:46 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 2 Jun 2014 20:47:58 +0000 (23:47 +0300)
commitd89a274af151f4158297d1e0d97d5cd911406c3f
treed7696ef2f083cc1575f3948014c4935782e07253
parent96b2e73c5471542cb9c622c4360716684f8797ed
vhost-net: extend device allocation to vmalloc

Michael Mueller provided a patch to reduce the size of
vhost-net structure as some allocations could fail under
memory pressure/fragmentation. We are still left with
high order allocations though.

This patch is handling the problem at the core level, allowing
vhost 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.

People are still looking at cleaner ways to handle the problem
at the API level, probably passing in multiple iovecs.
This hack seems consistent with approaches
taken since then by drivers/vhost/scsi.c and net/core/dev.c

Based on patch by Romain Francoise.

Cc: Michael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: Romain Francoise <romain@orebokech.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c