Re: [Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-26 Thread Christian Borntraeger
On 04/26/2016 10:26 AM, Zhou Jie wrote: > On 2016/4/26 15:45, Christian Borntraeger wrote: >> On 04/26/2016 03:26 AM, Zhou Jie wrote: >>> net_init_tap has a huge stack usage of 8192 bytes approx. >>> Moving large arrays to heap to reduce stack usage. >> >> I am wondering. Why is 8k a problem for a

Re: [Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
On 2016/4/26 15:45, Christian Borntraeger wrote: On 04/26/2016 03:26 AM, Zhou Jie wrote: net_init_tap has a huge stack usage of 8192 bytes approx. Moving large arrays to heap to reduce stack usage. I am wondering. Why is 8k a problem for a user space program? For 64bit machine it will be 16k.

Re: [Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-26 Thread Christian Borntraeger
On 04/26/2016 03:26 AM, Zhou Jie wrote: > net_init_tap has a huge stack usage of 8192 bytes approx. > Moving large arrays to heap to reduce stack usage. I am wondering. Why is 8k a problem for a user space program? Please note that malloc/new like allocations are much more expensive than stack a

Re: [Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-26 Thread Jason Wang
On 04/26/2016 09:26 AM, Zhou Jie wrote: > net_init_tap has a huge stack usage of 8192 bytes approx. > Moving large arrays to heap to reduce stack usage. > > Signed-off-by: Zhou Jie > --- > net/tap.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/net/tap.c b/net/t

[Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-25 Thread Zhou Jie
net_init_tap has a huge stack usage of 8192 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie --- net/tap.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/tap.c b/net/tap.c index 740e8a2..49817c7 100644 --- a/net/tap.c +++ b/n