Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-22 Thread Jason Wang
On 02/22/2013 09:18 PM, Anthony Liguori wrote: > Stefan Hajnoczi writes: > >> On Thu, Feb 21, 2013 at 05:45:57PM +0800, Jason Wang wrote: >>> @@ -1397,6 +1398,7 @@ void virtio_net_exit(VirtIODevice *vdev) >>> >>> g_free(n->mac_table.macs); >>> g_free(n->vlans); >>> +g_free(n->vqs);

Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-22 Thread Anthony Liguori
Stefan Hajnoczi writes: > On Thu, Feb 21, 2013 at 05:45:57PM +0800, Jason Wang wrote: >> @@ -1397,6 +1398,7 @@ void virtio_net_exit(VirtIODevice *vdev) >> >> g_free(n->mac_table.macs); >> g_free(n->vlans); >> +g_free(n->vqs); >> >> for (i = 0; i < n->max_queues; i++) { >>

Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-22 Thread Stefan Hajnoczi
On Thu, Feb 21, 2013 at 05:45:57PM +0800, Jason Wang wrote: > @@ -1397,6 +1398,7 @@ void virtio_net_exit(VirtIODevice *vdev) > > g_free(n->mac_table.macs); > g_free(n->vlans); > +g_free(n->vqs); > > for (i = 0; i < n->max_queues; i++) { > VirtIONetQueue *q = &n->vqs[

Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-21 Thread Jason Wang
On 02/22/2013 06:32 AM, Anthony Liguori wrote: > Jason Wang writes: > >> Edivaldo reports a problem that the array of NetClientState in NICState is >> too >> large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is >> not >> used. >> >> Instead of static arrays, solving this is

Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-21 Thread Anthony Liguori
Jason Wang writes: > Edivaldo reports a problem that the array of NetClientState in NICState is too > large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is not > used. > > Instead of static arrays, solving this issue by allocating the queues on > demand > for both the NetCli

[Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-21 Thread Jason Wang
Edivaldo reports a problem that the array of NetClientState in NICState is too large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is not used. Instead of static arrays, solving this issue by allocating the queues on demand for both the NetClientState array in NICState and Virt