From patchwork Mon May 9 10:30:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9044541 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD14E9F30C for ; Mon, 9 May 2016 10:32:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE9882012D for ; Mon, 9 May 2016 10:32:48 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 084072012B for ; Mon, 9 May 2016 10:32:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aziSi-00007L-Ix; Mon, 09 May 2016 10:30:52 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aziSg-00007B-MY for xen-devel@lists.xenproject.org; Mon, 09 May 2016 10:30:50 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 42/E8-18833-AD660375; Mon, 09 May 2016 10:30:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsXitHSDve7NNIN wgztLtSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozeZ80sBSd4K54e6WdqYNzO3cXIySEh4C/x vfstO4gtLBAqMevDTSCbi0NEYDmjxPu1l1hBEkICThITz6wDK2IWcJGY1/SeEcRmE9CReLxkB licV0BT4v7sPhYQm0VARaLz6xwmEFtUIFjizoXnbBA1ghInZz4Bq+EUcJb49mwukM0BNFNTYv 0ufYjx8hLNW2czQ6xVkfi4dhUrxJ3cErdPT2WewMg/C8mkWQjds5B0L2BkXsWoXpxaVJZapGu sl1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kRGIAMQLCDseOf0yFGSQ4mJVFeV0a9 cCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvGapBuFCgkWp6akVaZk5wFiASUtw8CiJ8PqApHmLC xJzizPTIVKnGBWlxHktgREkJACSyCjNg2uDxd8lRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCf PagoznycwrgZv+CmgxE9BiOTZ9kMUliQgpqQbGXXldz3iO9cWdTcu6tLZSTq2dZzbbsokZW7T 5vVJfzLv3bOZ2p92bE/7/zTire2R/wf9+cTO2aue4S3PmVmdG2e2T/7Cny0V0rsoE31thZl9/ m9YrLJ5R5vRt7xxdFgHfL10HTF3mmfU8vKHidjxxhYK40+pLlmeT2ZntW9cLHtXfOmFfio+DE ktxRqKhFnNRcSIAIJQBALoCAAA= X-Env-Sender: prvs=9302cc4b2=david.vrabel@citrix.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1462789848!3468646!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23602 invoked from network); 9 May 2016 10:30:49 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 9 May 2016 10:30:49 -0000 X-IronPort-AV: E=Sophos;i="5.24,600,1454976000"; d="scan'208";a="359180625" To: Heinrich Schuchardt , Boris Ostrovsky , David Vrabel , "Juergen Gross" References: <1462609046-10559-1-git-send-email-xypron.glpk@gmx.de> 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> X-DLP: MIA2 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 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) struct gnttab_copy ops[GNTDEV_COPY_BATCH]; 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 {