From patchwork Wed Aug 17 17:17:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9286199 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 0DD096086A for ; Wed, 17 Aug 2016 17:20:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F25C629487 for ; Wed, 17 Aug 2016 17:20:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6FFA29499; Wed, 17 Aug 2016 17:20:15 +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 9B014294A2 for ; Wed, 17 Aug 2016 17:20:13 +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 1ba4TQ-000890-4g; Wed, 17 Aug 2016 17:17:52 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba4TP-00088k-4x for xen-devel@lists.xenproject.org; Wed, 17 Aug 2016 17:17:51 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id F8/62-15404-E3C94B75; Wed, 17 Aug 2016 17:17:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRWlGSWpSXmKPExsXiVRvkrGs7Z0u 4wbPJehbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8are/uZCq7wVbza8IW1gfEHVxcjF4eQwExG iZuTellBHBaBNawSy/6eZARxJAQusUo0fH8B5HACOTESd3rfsEDYVRKdT3uZQWwhARWJm9tXM UGMms8k8ePEPLAiYQE9iSNHf7B3MXIA2YESM86qgoTZBAwk3uzYywpiiwgoSdxbNZkJxGYWaG aUWD9ZCsRmEVCV2Dn7Oth8XgFviXf/ZoDdwCngI3Fr9W8WiL3eEocn97CB2KICchIrL7ewQtQ LSpyc+YQFZC2zgKbE+l36EOPlJba/ncM8gVFkFpKqWQhVs5BULWBkXsWoXpxaVJZapGuhl1SU mZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kRGPwMQLCDcfZl/0OMkhxMSqK8d6q3hAvxJ eWnVGYkFmfEF5XmpBYfYtTg4BCYcHbudCYplrz8vFQlCV612UB1gkWp6akVaZk5wPiEKZXg4F ES4a0FSfMWFyTmFmemQ6ROMepybJl6by2TENgMKXHeFJAiAZCijNI8uBGwVHGJUVZKmJcR6EA hnoLUotzMElT5V4ziHIxKwrz6IFN4MvNK4Da9AjqCCegIXn6wI0oSEVJSDYyxulKXbvVdnVH8 8MtuwX1Lb+f/Xbz04UHFu5z1cWxMOgy99i1s/D+Djkw75aYxcX/h15XXglYbeEu92nd72vGK7 UKel/n6TgZ/me4U63S6MN7/fstNLZ7lvRMm3ZvPadC0JH11g2Tm7T27uIVy3pusXzh1Ojfrtu 61q6oa7G17ti98wprSaTBbiaU4I9FQi7moOBEAAqFEJxADAAA= X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1471454269!54454768!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 61198 invoked from network); 17 Aug 2016 17:17:49 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-9.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Aug 2016 17:17:49 -0000 Received: by mail-wm0-f67.google.com with SMTP id q128so26267098wma.1 for ; Wed, 17 Aug 2016 10:17:49 -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=fIstwFbrsFDEfFrYjUa/oaRwBAPxmaWtq+XlG3LFtVM=; b=IVGFCiGzQGthi7+vjGU6FxdJo0AnVklwyTJ3cxP8YS4XuM7GPAOVnFbVjS7XafXBH+ x3XZh1nVoidZqafnAA/byjGpxHVcGvlfyn2wLh4d8Csm9qUQlsk/3aVXJCEtYXsCfcSr t8dPW1Tad0TfZoklPq0VZO+aZeJzHNNQ3RhJsm+RiE/YIYDx6siUI0MccL2GNG+onupN NMULs8irVobSISww5y901fUaALN5sDVtqZLs4cnpdwL3hRHGAHEpTLZs7HkHKi1T9do/ UyLUi4/wIpYRPYYK7kGQKBpJSCbHwcQJFqZ4K6HmP2rM81UUENpVHpilHTWwrFxGLFJd 4UOw== 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=fIstwFbrsFDEfFrYjUa/oaRwBAPxmaWtq+XlG3LFtVM=; b=hTTmqIVP9ApthfkXr9F9Ml63COtNMcZhX6ZWu/Ki6czdzVjiXCnUIqJwPeO+PHWCzJ TzFIlbZzucjcGYK/PyvUQs7ySFCVgMB2vUsI/QAGp1Wrgt2opU3WKnVWis9GE8bUdnwr zmhwOmVTa//eatFzIGsJjDk5VWEktoINmkojFc/byII0yZuH2YGAzzyvh9rixR/zGM/S SmJ/sxaEgzYJsOHHO0yHTcGleYmOybkCgiVci1AueBMvHFUwRtbVGW7o5FdhGpMrfzxL SqCTOHiVqWAlGxHxXQGPhcCwQ2XQLIyRR0SnKmew/RAsk/LmwWIPI8rE1fC7AYTMa6KT KRvw== X-Gm-Message-State: AEkoous83BJfejybfL1VX66Zg21tFH3ZogIeB4F5oGOjxJChbfpF1C+J//OM9SmUu2/ucQ== X-Received: by 10.28.27.211 with SMTP id b202mr29093003wmb.12.1471454269130; Wed, 17 Aug 2016 10:17:49 -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 bc10sm32515997wjc.32.2016.08.17.10.17.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2016 10:17:48 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 17 Aug 2016 19:17:47 +0200 Message-ID: <147145426725.25877.3430896482552948117.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 , David Vrabel , George Dunlap Subject: [Xen-devel] [PATCH 02/24] xen: credit1: fix mask to be used for tickling in Credit1 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 If there are idle pcpus inside the waking vcpu's soft-affinity mask, we should really tickle one of them (this is one of the purposes of the __runq_tickle() function itself!), not just any idle pcpu. The issue has been introduced in 02ea5031825d ("credit1: properly deal with pCPUs not in any cpupool"), where the usage of idle_mask is changed, without updating the bottom of the function, where it is also referenced. Signed-off-by: Dario Faggioli Acked-by: George Dunlap --- Cc: George Dunlap Cc: Anshul Makkar Cc: David Vrabel --- David, a while ago you asked what could have been that was causing awful results for Credit1, for CPU bound workloads, in the overloaded scenario of one of my benchmarks. I think the bug fixed either here or in next patch (but I'd be rather sure it's this one) is where the problem was. :-) --- xen/common/sched_credit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 6eccf09..3d4f223 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -454,11 +454,12 @@ static inline void __runq_tickle(struct csched_vcpu *new) if ( opt_tickle_one_idle ) { this_cpu(last_tickle_cpu) = - cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask); + cpumask_cycle(this_cpu(last_tickle_cpu), + cpumask_scratch_cpu(cpu)); __cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask); } else - cpumask_or(&mask, &mask, &idle_mask); + cpumask_or(&mask, &mask, cpumask_scratch_cpu(cpu)); } /* Did we find anyone? */