From patchwork Tue Jan 10 13:32:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 9507191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 661C8606E1 for ; Tue, 10 Jan 2017 13:35:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5726C28406 for ; Tue, 10 Jan 2017 13:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A169284D2; Tue, 10 Jan 2017 13:35:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id DCEE628406 for ; Tue, 10 Jan 2017 13:35:03 +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 1cQwXt-0007x4-QV; Tue, 10 Jan 2017 13:33:01 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQwXs-0007wK-29 for xen-devel@lists.xenproject.org; Tue, 10 Jan 2017 13:33:00 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 1C/FD-27165-B82E4785; Tue, 10 Jan 2017 13:32:59 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRWlGSWpSXmKPExsVyuP0Ov27Xo5I Ig0kPTS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ox9n8sKPnBVrPm4kr2BcRpnFyMnh4SAkcTb if+Yuhi5OIQEFjJK9LZ0MYEk2ARUJTZcP8UKYosIREk8/9fDDmIzCxRItLb+Yuti5OAQFvCXm LGAFyTMAlS+/yxECa+AscSDS9PYIObLSyw8fwRsJKeAiUTH9F9gI4WAarbN2sE8gZF7ASPDKk b14tSistQiXWO9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYxAzzIAwQ7Gjn9Ohxg lOZiURHmPTyiJEOJLyk+pzEgszogvKs1JLT7EKMPBoSTBe+QhUE6wKDU9tSItMwcYYjBpCQ4e JRHezSBp3uKCxNzizHSI1ClGRSlx3lUgCQGQREZpHlwbLKwvMcpKCfMyAh0ixFOQWpSbWYIq/ 4pRnINRSZh3D8gUnsy8Erjpr4AWMwEtjrQrBllckoiQkmpgrNCZP6nQM3vPprs7bD7svfB0Rb Fxm2rlXc8L9i/1/e5VKAhEZXP/OHPef2mLzgS7jc8k9wuardAS+30rLHWypPFJL8ez6hZ3X+W Wc7EsZmLMZ9v+btvJZOH5u7qU6rc/t0w/fE55S1nLPaGWXyz7vLUvGed5LFrjcyR26XYe3RZl hq6+5fP4lViKMxINtZiLihMBHv/sSWYCAAA= X-Env-Sender: jgross@suse.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1484055178!79688711!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7112 invoked from network); 10 Jan 2017 13:32:58 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-12.tower-27.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 10 Jan 2017 13:32:58 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6D4ADAC97; Tue, 10 Jan 2017 13:32:57 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, netdev@vger.kernel.org Date: Tue, 10 Jan 2017 14:32:51 +0100 Message-Id: <20170110133252.5346-2-jgross@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170110133252.5346-1-jgross@suse.com> References: <20170110133252.5346-1-jgross@suse.com> Cc: Juergen Gross , boris.ostrovsky@oracle.com, paul.durrant@citrix.com, wei.liu2@citrix.com Subject: [Xen-devel] [PATCH 1/2] xen/netfront: set default upper limit of tx/rx queues to 8 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The default for the number of tx/rx queues of one interface is the number of vcpus of the system today. As each queue pair reserves 512 grant pages this default consumes a ridiculous number of grants for large guests. Limit the queue number to 8 as default. This value can be modified via a module parameter if required. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- drivers/net/xen-netfront.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index a479cd9..490c865 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -57,6 +57,7 @@ #include /* Module parameters */ +#define MAX_QUEUES_DEFAULT 8 static unsigned int xennet_max_queues; module_param_named(max_queues, xennet_max_queues, uint, 0644); MODULE_PARM_DESC(max_queues, @@ -2164,11 +2165,12 @@ static int __init netif_init(void) pr_info("Initialising Xen virtual ethernet driver\n"); - /* Allow as many queues as there are CPUs if user has not + /* Allow as many queues as there are CPUs inut max. 8 if user has not * specified a value. */ if (xennet_max_queues == 0) - xennet_max_queues = num_online_cpus(); + xennet_max_queues = min_t(unsigned int, MAX_QUEUES_DEFAULT, + num_online_cpus()); return xenbus_register_frontend(&netfront_driver); }