From patchwork Fri Jun 17 23:12:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9185143 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 3CD6B601C0 for ; Fri, 17 Jun 2016 23:14:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2843A200E7 for ; Fri, 17 Jun 2016 23:14:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D1BA27F07; Fri, 17 Jun 2016 23:14:12 +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 BA606200E7 for ; Fri, 17 Jun 2016 23:14:11 +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 1bE2w7-0003RY-7D; Fri, 17 Jun 2016 23:12:27 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE2w6-0003Qb-Dw for xen-devel@lists.xenproject.org; Fri, 17 Jun 2016 23:12:26 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id 44/D0-09881-9D384675; Fri, 17 Jun 2016 23:12:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmleJIrShJLcpLzFFi42Lxqg1y1r3ZnBJ u8Gcyk8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvH43wOmgsl8FfdbmpkaGD9wdTFycQgJTGeU OHXsMDOIwyKwhlVizc1WdhBHQuASq8SX63NYuhg5gJwYiflbiroYOYHMcon3HXsYQWwhARWJm 9tXMUFMWsAk8fTkLhaQhLCAnsSRoz/YQXqFBdIlbj4XBgmzCRhIvNmxlxXEFhFQkri3ajJYL7 NAA6PEhMe7mEASLAKqEk/OPAObwyvgI3F7P8h1nBycAr4Sq6/sYoNY7CNx8dwjMFtUQE5i5eU WVoh6QYmTM5+A3cwsoCmxfpc+SJhZQF5i+9s5zBMYRWYhqZqFUDULSdUCRuZVjOrFqUVlqUW6 JnpJRZnpGSW5iZk5uoaGJnq5qcXFiempOYlJxXrJ+bmbGIHBzwAEOxhXLHQ+xCjJwaQkynulM iVciC8pP6UyI7E4I76oNCe1+BCjHgeHwJWDR2YzCkw4O3c6kxRLXn5eqpIE74YmoGrBotT01I q0zBxgrMI0SHDwKInw7gRJ8xYXJOYWZ6ZDpE4x6nJsmXpvLZMQ2Awpcd7NIEUCIEUZpXlwI2B p4xKjrJQwLyPQmUI8BalFuZklqPKvGMU5GJWEeWeCTOHJzCuB2/QK6AgmoCM05yWDHFGSiJCS amCM+LU+LpTvwYXv21QWdV+fcPIT3+tYWd78DXF5yxPkEm6I/8k3vt0wKyRC9dga5arWl6Gnb /89/jTR97BotNCDRs8/Gt/dj0+4w73v8FTvfPnVqhNbI0+KFeRtreqNlrmi+NLwybevrTOMeS RiK649NZu7RXX/U7n31w0z3whazQqLPrl/n+ZzJZbijERDLeai4kQAKxCNIxYDAAA= X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1466205144!48408664!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29525 invoked from network); 17 Jun 2016 23:12:24 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-5.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Jun 2016 23:12:24 -0000 Received: by mail-wm0-f67.google.com with SMTP id 187so1092109wmz.1 for ; Fri, 17 Jun 2016 16:12:24 -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=0vUlaNiylpA5CD2JJQWjH+i0OdU38YXI6cqaK+9QOoM=; b=qrHLlu0zewVvMnmrCh5IY7nf8KnSjoujN3FThfOe1FM9oQljGvJibCiWrYIoTHJsAm CHIbrAGqDmZtpCCiLWQobiy2tHJsZOSugMrP1W3GZPwSes5SOYquTeSxdE9pH0K9Z36B wF1uCFnmivryH0pBqUy7QEBWfWL4597ZlfCjctimsyda8z7mydBDeDLRFbtnvW3rt4tk DNZuv9Un/Bupa73IQFlU5SisQNaZ5NlxmG/9Kp6SkMYGFA/+o25WOSfIn3/jGSIgQLmY kEV0nGRbSKQ7j7Y5EJxOByYYaV+ZohxhmEtDICc8l7KYWcp4KUr0MdUSaIH3vUs/RCkF vVtA== 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=0vUlaNiylpA5CD2JJQWjH+i0OdU38YXI6cqaK+9QOoM=; b=UvldEcxnLU8bbeUQfOTySvB4HgMdYHkdibZGt9kN51liT8LnHQQN7otAg64UjpwLGv 1Ecdf9xj8GlkVr9n7nkbKmUj8FkAF02Nz8/vfImAfaNBk9u7M/pT3Ie7foKzC1QHg3J1 9gU2e13P2x/6xH2Whhtr/3AGq37cN6bgvSf1oISkjUKB3KqffAeovmmyY70i5U9XRJ44 P62qk79p0icbbUVy0LCrf34OMzr9GYGW8ZZ4esHlGvqUXCnWAL4sijAuBGGsQqPkA2ld /krS7kUpNpX+FbP0Eb+l1bPQo3gdWYL+aRajTuKoS4xc6O4k9QTop4jEOaJUJSNWhV/9 B6pQ== X-Gm-Message-State: ALyK8tJWY5SfvEMFBb8X6NxczI+Gq2UMUumg9HP6Mk0yiGylvmCSAxyASvvI4KW6WmtHMw== X-Received: by 10.28.64.213 with SMTP id n204mr701704wma.7.1466205144312; Fri, 17 Jun 2016 16:12:24 -0700 (PDT) Received: from Solace.fritz.box (net-93-65-149-191.cust.vodafonedsl.it. [93.65.149.191]) by smtp.gmail.com with ESMTPSA id v200sm873970wmv.4.2016.06.17.16.12.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 16:12:23 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Sat, 18 Jun 2016 01:12:22 +0200 Message-ID: <146620514206.29766.13965940175057904519.stgit@Solace.fritz.box> In-Reply-To: <146620492155.29766.10321123657058307698.stgit@Solace.fritz.box> References: <146620492155.29766.10321123657058307698.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Anshul Makkar , George Dunlap , David Vrabel Subject: [Xen-devel] [PATCH 09/19] xen: credit2: avoid calling __update_svc_load() multiple times on the same vcpu 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 by not resetting the variable that should guard against that at the beginning of each step of the outer loop. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- Cc: George Dunlap Cc: Anshul Makkar Cc: David Vrabel --- xen/common/sched_credit2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index af28e7b..c534f9c 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -1378,6 +1378,7 @@ static void balance_load(const struct scheduler *ops, int cpu, s_time_t now) struct csched2_private *prv = CSCHED2_PRIV(ops); int i, max_delta_rqi = -1; struct list_head *push_iter, *pull_iter; + bool_t inner_load_updated = 0; balance_state_t st = { .best_push_svc = NULL, .best_pull_svc = NULL }; @@ -1478,7 +1479,6 @@ static void balance_load(const struct scheduler *ops, int cpu, s_time_t now) /* Reuse load delta (as we're trying to minimize it) */ list_for_each( push_iter, &st.lrqd->svc ) { - int inner_load_updated = 0; struct csched2_vcpu * push_svc = list_entry(push_iter, struct csched2_vcpu, rqd_elem); __update_svc_load(ops, push_svc, 0, now); @@ -1490,10 +1490,8 @@ static void balance_load(const struct scheduler *ops, int cpu, s_time_t now) { struct csched2_vcpu * pull_svc = list_entry(pull_iter, struct csched2_vcpu, rqd_elem); - if ( ! inner_load_updated ) - { + if ( !inner_load_updated ) __update_svc_load(ops, pull_svc, 0, now); - } if ( !vcpu_is_migrateable(pull_svc, st.lrqd) ) continue;