From patchwork Wed Aug 17 17:20:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9286243 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 BD75260839 for ; Wed, 17 Aug 2016 17:22:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE374294A2 for ; Wed, 17 Aug 2016 17:22:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3414294B8; Wed, 17 Aug 2016 17:22:29 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 2C4E9294A2 for ; Wed, 17 Aug 2016 17:22:29 +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 1ba4Vg-0001hf-G8; Wed, 17 Aug 2016 17:20:12 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba4Vf-0001g8-He for xen-devel@lists.xenproject.org; Wed, 17 Aug 2016 17:20:11 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id E7/1E-29563-ACC94B75; Wed, 17 Aug 2016 17:20:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFIsWRWlGSWpSXmKPExsXiVRvkrHtqzpZ wgw9HxC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozv8/eyF+zgrmj585e9gXE7ZxcjJ4eQwAxG ifdLPUBsFoE1rBLvGkW7GLk4JAQusUps/7WKuYuRA8iJkTh0VB6kRkKgQqLj/hQWiF4ViZvbV zGB1AsJzGeSWDnhKjNIQlhAT+LI0R/sIL3CAnYSC9cEgYTZBAwk3uzYywpiiwgoSdxbNZkJpI RZIFxidSc3xAmqEpdXrGIDsXkFfCQet7wEK+cEsm+t/g211lvi8OQesBpRATmJlZdbWCHqBSV OznzCAjFSU2L9Ln2QMLOAvMT2t3OYJzCKzEJSNQuhahaSqgWMzKsYNYpTi8pSi3SNjPSSijLT M0pyEzNzdA0NzPRyU4uLE9NTcxKTivWS83M3MQLDngEIdjCumR94iFGSg0lJlPdO9ZZwIb6k/ JTKjMTijPii0pzU4kOMGhwcAhPOzp3OJMWSl5+XqiTB2zMbqE6wKDU9tSItMwcYmTClEhw8Si K8O0HSvMUFibnFmekQqVOMuhxbpt5byyQENkNKnDcFpEgApCijNA9uBCxJXGKUlRLmZQQ6UIi nILUoN7MEVf4VozgHo5Iw7zKQKTyZeSVwm14BHcEEdAQvP9gRJYkIKakGxmbbn3dmhy04dvJR 7fWqiYeOXVPRbar1nRn5YdNtySf7mQu+HY+6nHpAeO9Ni09L837w2QS6OHFeb2X4Jsjl9n6B7 OPJx/N1W7TdHv58oW4U73CIx/jKjFMOV1IYPtaxzvH42B84iStHR8s4R8p3uuGpufsWugiE9H 6KYX6RK24q+Sg70bkjSYmlOCPRUIu5qDgRABcckVINAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1471454410!53622749!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11212 invoked from network); 17 Aug 2016 17:20:10 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Aug 2016 17:20:10 -0000 Received: by mail-wm0-f67.google.com with SMTP id o80so26331015wme.0 for ; Wed, 17 Aug 2016 10:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=SQzPyqJanpZDeoxBcQxx7FDt5ZlWdIDwO/nkkgz3gAU=; b=U1d1d+l/VWj7AfBnFZtSsfNKblLLAzbAb5xflaagVUskWKrDJ4XceKR4fA0xBwz3ou t+BHPr39wwKMavgBTKVwTHl6JdMjkZSUMDhLodXfbEbuAEfEdxsU+Z5Zeo9Ay5WzoEGC QxTbJg+obR+HBdpMANFUvNgJynhofxn0qJaCkmN/dy9SqqTGARjPzKLzl4QbLPwPS465 xM7LIUfIAb81lvpbbSSRihP4wJWUZO2uZn4mP9o9OxqSnlpg+SfPDee3AcyByDmZs+Hd GXO06g8xReTLQddNdIwhUfURodGwLecEwq1dCP49ePrpdoCAYqCmybeZ6tqIrrjV1KDe ENtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=SQzPyqJanpZDeoxBcQxx7FDt5ZlWdIDwO/nkkgz3gAU=; b=hOzJhAMf1d2HTIlUFWhJmCrHInBgAvMYMRMcM/Fm8kBpRHk2Xef1m7eG4P/AH/r7Nc 8nPhGmpzf+58rLi1VZ9LBGwiHp2T3s6tD2yemMls6l6ry/iTa2bF2oL6uceBxc5V0k9o wAqG9uuwIV4tmTXKXDoHd7uLL4kCujK2mhdsqaTpDREhgwIvsHYnkNpnecmlFSBkAod5 g2ZjHwgF71zOmNs2XRAfM0sy16ovurT6fpkH++xTQVlL+l5qLy6Hv15fIvHVjTEI+knZ XcQLktGVtkSqMs4+SdnYnparFUiiy8akYXpP0P5NXHUXJkwNoz3NxnuC+uKgEaCU+nDC kpeg== X-Gm-Message-State: AEkooutz+D7OCoKeWS2kOmxoc3nuhgrFvPGeaGLY2Cg0AO8PzoGXS76fb/itUoKHN7xtng== X-Received: by 10.28.10.194 with SMTP id 185mr1509337wmk.53.1471454409974; Wed, 17 Aug 2016 10:20:09 -0700 (PDT) Received: from Solace.fritz.box (net-2-32-14-104.cust.vodafonedsl.it. [2.32.14.104]) by smtp.gmail.com with ESMTPSA id m127sm27530512wmm.21.2016.08.17.10.20.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2016 10:20:09 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 17 Aug 2016 19:20:08 +0200 Message-ID: <147145440828.25877.10082549766938645168.stgit@Solace.fritz.box> In-Reply-To: <147145358844.25877.7490417583264534196.stgit@Solace.fritz.box> References: <147145358844.25877.7490417583264534196.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Anshul Makkar , George Dunlap Subject: [Xen-devel] [PATCH 22/24] xen: credit2: "relax" CSCHED2_MAX_TIMER 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-Virus-Scanned: ClamAV using ClamSMTP Credit2 is already event based, rather than tick based. This means, the time at which the (i+1)-eth scheduling decision needs to happen is computed during the i-eth scheduling decision, and a timer is set accordingly. If there's nothing imminent (or, the most imminent event is really really really far away), it is ok to say "well, let's double-check things in a little bit anyway", but such 'little bit' does not need to be too little, as, most likely, it's just pure overhead. The current period, for this "safety catch"-alike timer is 2ms, which indeed is high, but it can well be higher. In fact, benchmarks show that setting it to 10ms --combined with other optimizations-- does actually improve performance. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- Cc: George Dunlap Cc: Anshul Makkar --- xen/common/sched_credit2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 21b1f91..6963872 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -152,7 +152,7 @@ /* Reset: Value below which credit will be reset. */ #define CSCHED2_CREDIT_RESET 0 /* Max timer: Maximum time a guest can be run for. */ -#define CSCHED2_MAX_TIMER MILLISECS(2) +#define CSCHED2_MAX_TIMER CSCHED2_CREDIT_INIT #define CSCHED2_IDLE_CREDIT (-(1<<30))