Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp404558pxb; Sat, 6 Mar 2021 03:47:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9JeCzebBqnLI3Za+VMgOuutVjUg+pZbf7cRl6jR2riFS3EOXrzvg1Fbjra2FfEdgzDo1k X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr13734864edv.374.1615031235447; Sat, 06 Mar 2021 03:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615031235; cv=none; d=google.com; s=arc-20160816; b=h5GfZB3+mdab3upFDfE2nFuda7ilNyt1+QAnxhrb9TVxf2BkkUWwJoLgDrecbDP1qS WFwCalpV3txCwykAiZbjGMmxEMJYdIaw9DmKoFsGgpRs7TMydKtzx22NY156S6UKsplq vLmK2Uum1/KstK7gpp2MM5srJZT94mSrmRXEdp3mkRCqt8cGuQTbOXx7U8yipM4Z5weE pFr3bWIeLDwK92pObO3GKyC0avyTtukZiGWn2hP6ZPSeIbr9cY9OgIMjSZ9V3JKaS3Kq 6J3s9frTIRE+cSKxSTIqfZVhMoa2qTPoOTMWMB2rRlKAzii9VrtrnwhChvBfl8ChgBgI TpsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Qsw2WE1+MvXulfIXG8A3/jUIUo5ACxc908hJJVX9mA8=; b=YpWXjehtDh8BOaF0se+9yuDa8BlH+vPZ3rM28RLigX63EfSSifFtgYNyszr7tQddKR 42/EDPzLDZPkWOcID4D4N2wrjdDKN+jfPn0d/ykxXItfbtxC5rloQ5V+6ix3a2nAIeF9 5nJUlM9H5mx7D0+VBltuJ1FTZNklRDmlXp5/04gJH9SZKVwQA0KhqJQP1G6EazGhwKFJ i0pLZ1/byvHJuoZ2qdIJ5Wm5AH3mRD2oM4+2fbfvSJgcVU/ctTz+iLIEBoNqF2PnmzUa 3w7G55zXp1B6xBfTlCj2kfrjMgFQ3dUNcrTcJmhG/4FLF8M8kRo87HbN9LzJQoa4tz1N NOcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FomlMWEG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=X3rj9nWm; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si3218743ejm.72.2021.03.06.03.46.51; Sat, 06 Mar 2021 03:47:15 -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=@linutronix.de header.s=2020 header.b=FomlMWEG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=X3rj9nWm; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231315AbhCFLmu (ORCPT + 99 others); Sat, 6 Mar 2021 06:42:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbhCFLmZ (ORCPT ); Sat, 6 Mar 2021 06:42:25 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E236BC061760; Sat, 6 Mar 2021 03:42:24 -0800 (PST) Date: Sat, 06 Mar 2021 11:42:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1615030943; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qsw2WE1+MvXulfIXG8A3/jUIUo5ACxc908hJJVX9mA8=; b=FomlMWEGidlKAWkqPNhQYPDH69UaJrTnURfC11D0NQYpm1hqHPvqaLLQUiPi0voEBRfnyp mtdLP3A3JjkvMGmvntQJY8Zih4yDA/Q01Zb9VOMiTgPvxjStBbAlp1iA4sZVlic/XiKItf zaTv0Z5qwq+X3QG3+5zhra84ZbAo84jW1mH2zqqCuO0sxj0zCaguPXKNHSgzXEzFUng4R3 TJDruHJFaHs6gmxamK0Gtn1VSHlLBxyZImwnsOh6BiZ/64qeN55vXB73tKrXgK2uoD9YME eEYJKNAKNs+Pe4RHgme/A6iJXFXSuIubBXEJgrwKKljdBjC0+4RMHr70hfn3zg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1615030943; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qsw2WE1+MvXulfIXG8A3/jUIUo5ACxc908hJJVX9mA8=; b=X3rj9nWmxketGkKyCs8/hkCpGfVw7L0oWGILmAtyfY9DsETJ1B0YrlLcBoilkCRfZ2CI4r Un22FErI4KFlplDg== From: "tip-bot2 for Vincent Guittot" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Reorder newidle_balance pulled_task tests Cc: Vincent Guittot , "Peter Zijlstra (Intel)" , Ingo Molnar , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210224133007.28644-6-vincent.guittot@linaro.org> References: <20210224133007.28644-6-vincent.guittot@linaro.org> MIME-Version: 1.0 Message-ID: <161503094242.398.15769339852881637506.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 6553fc18179113a11835d5fde1735259f8943a55 Gitweb: https://git.kernel.org/tip/6553fc18179113a11835d5fde1735259f8943a55 Author: Vincent Guittot AuthorDate: Wed, 24 Feb 2021 14:30:05 +01:00 Committer: Ingo Molnar CommitterDate: Sat, 06 Mar 2021 12:40:21 +01:00 sched/fair: Reorder newidle_balance pulled_task tests Reorder the tests and skip useless ones when no load balance has been performed and rq lock has not been released. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Valentin Schneider Link: https://lkml.kernel.org/r/20210224133007.28644-6-vincent.guittot@linaro.org --- 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 3c00918..356a245 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10584,7 +10584,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, @@ -10593,14 +10592,15 @@ out: 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