[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libxl: stop libxl_domain_info() consuming massive amounts of stack


  • To: Paul Durrant <paul@xxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxx>
  • Date: Thu, 28 May 2020 15:56:53 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <pdurrant@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 28 May 2020 14:57:14 +0000
  • Ironport-sdr: XPQ4X+dE/6hyPkWA4jyUYtycJBETPYjzKjQDpDV2jMZLl6for62rN6bu0GdRjIapB3p6HWMozN 3mPz86sCuVkMDn4JNpauqJ5lAmCBPrY7PdaET+A+qs3ZHfaim6TEbz2BC7JDeP9T4fvI2q67ss PRDcqCMSI5iCYBxbjoW/KdxpuDaY3e3MAtWZyZW8uT+VDR6rZXNxH0dOIFQ3XWhdbnyZP4LIcZ qvliMunFzHgvdI1nI1EizD5vwDLQAuvlUA9MIJQEbberqp91cSAWehT1OpsGDG0k4Q5X+VAKUG 9wk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Paul Durrant writes ("[PATCH] libxl: stop libxl_domain_info() consuming massive 
amounts of stack"):
> From: Paul Durrant <pdurrant@xxxxxxxxxx>
> 
> Currently an array of 1024 xc_domaininfo_t is declared on stack. That alone
> consumes ~112k.

Wow.

> Since libxl_domain_info() creates a new gc this patch simply
> uses it to allocate the array instead.

Thanks.

> +    info = libxl__calloc(gc, 1024, sizeof(*info));

Wy not GCNEW_ARRAY ?

That avoids a possible bug with wrong number of * to sizeof (although
in this case you seem to have it right...)

Thanks,
Ian.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.