All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@citrix.com>
To: Paul Durrant <paul@xen.org>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Paul Durrant <pdurrant@amazon.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] libxl: stop libxl_domain_info() consuming massive amounts of stack
Date: Thu, 28 May 2020 15:56:53 +0100	[thread overview]
Message-ID: <24271.53557.114994.926329@mariner.uk.xensource.com> (raw)
In-Reply-To: <20200528114801.20241-1-paul@xen.org>

Paul Durrant writes ("[PATCH] libxl: stop libxl_domain_info() consuming massive amounts of stack"):
> From: Paul Durrant <pdurrant@amazon.com>
> 
> 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.


  reply	other threads:[~2020-05-28 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 11:48 [PATCH] libxl: stop libxl_domain_info() consuming massive amounts of stack Paul Durrant
2020-05-28 14:56 ` Ian Jackson [this message]
2020-05-28 14:58   ` Paul Durrant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24271.53557.114994.926329@mariner.uk.xensource.com \
    --to=ian.jackson@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=paul@xen.org \
    --cc=pdurrant@amazon.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.