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

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



> -----Original Message-----
> From: Ian Jackson <ian.jackson@xxxxxxxxxx>
> Sent: 28 May 2020 15:57
> To: Paul Durrant <paul@xxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; Paul Durrant <pdurrant@xxxxxxxxxx>; Wei 
> Liu <wl@xxxxxxx>; Anthony
> Perard <anthony.perard@xxxxxxxxxx>
> Subject: Re: [PATCH] libxl: stop libxl_domain_info() consuming massive 
> amounts of stack
> 
> 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 ?

'Cos I didn't know about that one :-)

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

Cool. I'll send a v2 in mo'.

  Paul

> Thanks,
> Ian.




 


Rackspace

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