vhost-net: extend device allocation to vmalloc
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 <a37db52a77a2139163eb019527c9d9ac319173fe@linux.vnet.ibm.com>
Signed-off-by: Romain Francoise <b8aabb4b95c817d9df69b6be95b2b94d6b1efe17@orebokech.com>
Acked-by: Michael S. Tsirkin <255103e50249e3d658441816e0597170ebfc16ef@redhat.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs