From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbcEIKau (ORCPT ); Mon, 9 May 2016 06:30:50 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:23082 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbcEIKat (ORCPT ); Mon, 9 May 2016 06:30:49 -0400 X-IronPort-AV: E=Sophos;i="5.24,600,1454976000"; d="scan'208";a="359180625" Subject: Re: [Xen-devel] [PATCH 1/1] xen/gntdev: kmalloc structure gntdev_copy_batch To: Heinrich Schuchardt , Boris Ostrovsky , David Vrabel , "Juergen Gross" References: <1462609046-10559-1-git-send-email-xypron.glpk@gmx.de> CC: , From: David Vrabel Message-ID: <573066D0.1030603@citrix.com> Date: Mon, 9 May 2016 11:30:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1462609046-10559-1-git-send-email-xypron.glpk@gmx.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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