All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	"Juergen Gross" <jgross@suse.com>
Cc: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/1] xen/gntdev: kmalloc structure gntdev_copy_batch
Date: Mon, 9 May 2016 11:30:40 +0100	[thread overview]
Message-ID: <573066D0.1030603@citrix.com> (raw)
In-Reply-To: <1462609046-10559-1-git-send-email-xypron.glpk@gmx.de>

On 07/05/16 09:17, Heinrich Schuchardt wrote:
> Commit a4cdb556cae0 ("xen/gntdev: add ioctl for grant copy")
> leads to a warning
> xen/gntdev.c: In function ‘gntdev_ioctl_grant_copy’:
> xen/gntdev.c:949:1: warning: the frame size of 1248 bytes
> is larger than 1024 bytes [-Wframe-larger-than=]
> 
> This can be avoided by using kmalloc instead of the stack.
> 
> Testing requires CONFIG_XEN_GNTDEV.

Thanks, but I've applied the following patch instead.

David

8<-------------
xen/gntdev: reduce copy batch size to 16

IOCTL_GNTDEV_GRANT_COPY batches copy operations to reduce the number
of hypercalls.  The stack is used to avoid a memory allocation in a
hot path. However, a batch size of 24 requires more than 1024 bytes of
stack which in some configurations causes a compiler warning.

    xen/gntdev.c: In function ‘gntdev_ioctl_grant_copy’:
    xen/gntdev.c:949:1: warning: the frame size of 1248 bytes is
    larger than 1024 bytes [-Wframe-larger-than=]

This is a harmless warning as there is still plenty of stack spare,
but people keep trying to "fix" it.  Reduce the batch size to 16 to
reduce stack usage to less than 1024 bytes.  This should have minimal
impact on performance.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/xen/gntdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index dc49538..6793957 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -748,7 +748,7 @@ static long gntdev_ioctl_notify(struct gntdev_priv
*priv, void __user *u)
 	return rc;
 }

-#define GNTDEV_COPY_BATCH 24
+#define GNTDEV_COPY_BATCH 16

 struct gntdev_copy_batch {
 	struct gnttab_copy ops[GNTDEV_COPY_BATCH];
-- 
2.1.4

      parent reply	other threads:[~2016-05-09 10:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-07  8:17 [PATCH 1/1] xen/gntdev: kmalloc structure gntdev_copy_batch Heinrich Schuchardt
2016-05-09  5:25 ` Juergen Gross
2016-05-09  5:25 ` Juergen Gross
2016-05-09  6:06 ` [Xen-devel] " Jan Beulich
2016-05-09  6:06 ` Jan Beulich
2016-05-09 10:30 ` David Vrabel
2016-05-09 10:30 ` David Vrabel [this message]

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=573066D0.1030603@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xypron.glpk@gmx.de \
    /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.