Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1880199pxb; Fri, 5 Feb 2021 03:55:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYJsUhLrNyNbJb+X60JqvjDy+xdfNW1JdteoqbQqFWcJBzzEUc7HsnK0NzLT/cp0pYr/eY X-Received: by 2002:a05:6402:d:: with SMTP id d13mr3172719edu.274.1612526159789; Fri, 05 Feb 2021 03:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612526159; cv=none; d=google.com; s=arc-20160816; b=Rw4+D67VaED+6AcWSTk/SvW886j0Tj2+tdJQ3orUwsIsKUBp9qBljuyvCbQbfOUHnJ OLYkqugY+ho63rZk2RTWpkjaPwjIES1cjplW3aGdsqxdMEcJr6rj7F5ki/RQBhTg/OtU Ohzfw0yPrSHVAkZ25ma4dsIXNvDKkTL40zmGwQ/lBKjHLKsUlF5pqOJv+CpFn/y1G01d IhLPh6XFx0rYGoLn3BhEcUOR0hUi6w+z4dOEkUe6Bo7eMvAc3d+hIPgF7bNdntSrcak1 /zSUbkgSb23/F2uRCiXzTvV2i4HWlm4nPTn0xcB7r5Zzgfd9VAiG/l8QsvWlHQ5j2/ng A4CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=R1k/G9W4vMVpJnpVB5SgdsbnWzbf5VfOkK8aj7ieetU=; b=i5x6p5KblDO1/1wSSnhPaU4Cw1eEwmHJqUbdYiL2eRvp1IhkMVlaZkX+yHlkeB4ctG ZEvqtzXHrunok/SNxyG6zX8Z9MjiEvWCeP+BcaREfr666kbw8bNaOK7Dyq2XyAioxRry sJoF4Hu6czKO77Dq+aqJEkAB6eDyK6XPHJ1H6JjI0Hdt4K4wy5y0M37WCBI9HdCE6chN FJ7UO+KLBLt2/Je1iW4BQteSSMvee/YE5GEOD6+lMCkCV9xva40Z6t1r7Ee00qDkCZsV j2Lrqbh8Bq8Kyaa98QM/24rzDvDNYET6wL7b0xlAE6KN9FHlcHQf4jKFo5v9sq5j1vFe l1hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VL8qh9ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si90172edh.270.2021.02.05.03.55.33; Fri, 05 Feb 2021 03:55:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VL8qh9ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231724AbhBELyG (ORCPT + 99 others); Fri, 5 Feb 2021 06:54:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbhBELtY (ORCPT ); Fri, 5 Feb 2021 06:49:24 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567B2C0617A7 for ; Fri, 5 Feb 2021 03:48:44 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id q7so7299612wre.13 for ; Fri, 05 Feb 2021 03:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R1k/G9W4vMVpJnpVB5SgdsbnWzbf5VfOkK8aj7ieetU=; b=VL8qh9wwj+URZ5yzW89Jcfthj5sOKKy7MuWnX0hN+xL7l28eNVmdCIqEbAYbpODw2h 9C/kkBEiArBR0MBW1kUGTrGIG7C8oVYBiFqobNEC0Z9aOKOeAn+YGLHPHe5kJRjA9+yf K/VT7FAxIwXMHIp3/ZC1mL90I2nfzOPBgJMwdxh6VPXeh7NrBgdUmE6mSRuAvEQ98Tok zWYQYA+rumNBrdEMQKdG0WtmUo5juRq1k/fEdqx/xR1Yb8vXDOK6qJmfEnTjUsVyViQs KoLlAbsRQhvVHDIpjoj4vWCt8QwbL6bNOm/vPxv9OY6r/hQbgjor8bvrzcS3IEcuOqXC THSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R1k/G9W4vMVpJnpVB5SgdsbnWzbf5VfOkK8aj7ieetU=; b=Oxfk/t258O15yR1KQ355APipB+Fdd8leRPiGnp+mAHFqMVYOz4V8rPSBmzdmDie7an vEloUcZRJvho1M42RkNas2wQf511U7eimATYrVSZyI7eNVJ/UlqIvmSbOvjbAivx7kL4 9MeYnzBNb8ie/HYIv6jhM+hAB+6N44p99ewDsp2P595zDWnWhJib+AvsuY4O6iWwp50V f/puXMgprwfDhnLpvD8+uzH42fGmCcLJ1oosxYDtGlFMSb5/oEhFfzaK2sydBF2dOQR9 nKE5htgPM0pCrLdSf+p1jpn6P40vB7Y2bNgw3nAJDg3WUKG0qsImeEn9GdQSzxSVkWe4 7y6w== X-Gm-Message-State: AOAM532ybTtsEh1rd/I47/3klkA1BQ8jnHtcDGlPZK1ooDfFFkUqzt0j eWbZblIg1stimN68tHV3Qo1gBw== X-Received: by 2002:a5d:4a09:: with SMTP id m9mr4667225wrq.122.1612525723097; Fri, 05 Feb 2021 03:48:43 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:442a:8956:28be:e500]) by smtp.gmail.com with ESMTPSA id z4sm11647586wrw.38.2021.02.05.03.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:48:42 -0800 (PST) From: Vincent Guittot To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, fweisbec@gmail.com, tglx@linutronix.de, bristot@redhat.com, linux-kernel@vger.kernel.org, joel@joelfernandes.org Cc: qais.yousef@arm.com, Vincent Guittot Subject: [PATCH 4/6] sched/fair: reorder newidle_balance pulled_task test Date: Fri, 5 Feb 2021 12:48:28 +0100 Message-Id: <20210205114830.781-5-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210205114830.781-1-vincent.guittot@linaro.org> References: <20210205114830.781-1-vincent.guittot@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reorder the tests and skip prevent useless test when no load balance has been performed. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c587af230010..935594cd5430 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10592,7 +10592,6 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) if (curr_cost > this_rq->max_idle_balance_cost) this_rq->max_idle_balance_cost = curr_cost; -out: /* * While browsing the domains, we released the rq lock, a task could * have been enqueued in the meantime. Since we're not going idle, @@ -10601,14 +10600,15 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) if (this_rq->cfs.h_nr_running && !pulled_task) pulled_task = 1; - /* Move the next balance forward */ - if (time_after(this_rq->next_balance, next_balance)) - this_rq->next_balance = next_balance; - /* Is there a task of a high priority class? */ if (this_rq->nr_running != this_rq->cfs.h_nr_running) pulled_task = -1; +out: + /* Move the next balance forward */ + if (time_after(this_rq->next_balance, next_balance)) + this_rq->next_balance = next_balance; + if (pulled_task) this_rq->idle_stamp = 0; else -- 2.17.1