Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp416689pxb; Tue, 19 Oct 2021 05:41:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG0Nw+5UHV7GFMXfRoeLMZYnYB6es+BOz7cuJr7cQzg5pSlhbQ9++Ypo/MG0vQKe3CUCUa X-Received: by 2002:a05:6402:348b:: with SMTP id v11mr52481891edc.296.1634647266001; Tue, 19 Oct 2021 05:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634647265; cv=none; d=google.com; s=arc-20160816; b=N8/REhjOZ8M0EdMOfw6mlAYGeIN2TcRsux9+aIyCbpepHnYbvPk/ZDOgA9lOuYF2hf E9ew3FSlh5IyNHfaUI1H4yIy/aTvLyNJk7j9fWXy4v+qxtqknS07L/nmsiuFFW91XjS+ VCgBtU4QV0h0WaByaksFaRkwr6wFHvPz15ZXRppDSR0nqnYM8e0ZahoyXIrui+QFhGhq iyWNniZMk7RnK5JR0vJSq4I81I5vQyYknpmjpIjhSxTHTWSe0sAFqsZOHb39uDQ5URmi ieEYadnr0KPmZWgEvivfxMxi7YMnEKQBT7ojo94N7RKOMCeZ0iZQPpV8BSWfT+3DHRRD /05g== 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=BDhXeFZOEER6fzhifbvaPju9Ij73EweA3xek0ZW9GxM=; b=AZ/HJZIZzy8wAOBnvJ0fGc5VxYLCBlEZDRGji6Tfk0P/Nkb4By6Po8BajgA9oziYJv 1sSUDt8wcF00okpyE6kg+2rcSBvaDypLmfUcCoGBHEb+TqKrfGHUoAxjr+USjkmx0WDq IGqrslhDbwMshF+sy6pFW/nlHduQneVwdXWYXqSbpL4HVF9Eye7jC5hvO2ZknSlOHLKA UXH6ZZzm1tL4jOx5xf+iIXOd7QWVK6QxpY9XwTDh+K5BZw94ESIoXE9WjHxKe3qo3IRM lw2TnJ/UzvVy70K40hKTVkf6xdsDgCrqFV+uYRKiO3NXMofnXW0roXx9AMJD+pTsNThg Cfhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="O/3N4FBb"; 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 ho39si22330999ejc.1.2021.10.19.05.40.36; Tue, 19 Oct 2021 05:41:05 -0700 (PDT) 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="O/3N4FBb"; 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 S235705AbhJSMiP (ORCPT + 99 others); Tue, 19 Oct 2021 08:38:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235728AbhJSMiF (ORCPT ); Tue, 19 Oct 2021 08:38:05 -0400 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 891F0C061765 for ; Tue, 19 Oct 2021 05:35:52 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id y3so47646013wrl.1 for ; Tue, 19 Oct 2021 05:35:52 -0700 (PDT) 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=BDhXeFZOEER6fzhifbvaPju9Ij73EweA3xek0ZW9GxM=; b=O/3N4FBblQXfYumsJFu0xnxZUEiNNfCAcDn5FUIfZN/ZOMf2qzlRE2RGnp01DUT5DG hsOmrTrA0EvNcuO6R7qDARn5Vegp7Qq0MKgQtrVy0y15ya7kTrml9OXt07T73O/NhFEB fVZLGipffqJ3LEkkGsc36QHqS98wDTmf/7nEY0NR3eJfNMtiM91oq5PAVo7iHzjkR223 4Qtnc7dPHi0jQIj89c73f+uNmzV1tgaLozBXZsf5aslVckc0q4qlAENM2pUNHsqXGulh VodH1RYZdZqBzVaR2cMHVAoqaVkBKoTr3b/T3UwoNdXyEXryq1sXTdi33ADhLZRj87lf nHaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BDhXeFZOEER6fzhifbvaPju9Ij73EweA3xek0ZW9GxM=; b=LxGcKmvR9RKjVsFQsx3uhz5x3g8GySgS7nC59dTZ8aWVTXSohm81kcLI/g3bt6JDWH W72Jo6sMeaHQQebpk6HVB51YuVky6xNHGmj/KEBmeUb2vgWuR6lGrPEOS7em4d+1SOf+ YjXjfbLQ0+NN2HUEs8u5RU0LeVc5yBxfKeYEDaKlC7zTD1+8w5UxiJdIl0enG5K4B3Pi cNtIVknwz9BBSism8fxHhs7chna96jiWrsdueZl24q8b5QvNAlahxYgbge+celBKxPRP UOl9FRL5a0OhiKqN2VWxSt7Ec+/XLPGwPoGmqT0spLmCTCnSKIxFjiQBQ1SvJWhhBqMF ONxA== X-Gm-Message-State: AOAM531phUoG22fjqn+bCWgUut8i7F+XkUdBS6n9cBcUMrCwGId6WD3w Nh0CWz+PI+9aH/X03xaLjGeQvw== X-Received: by 2002:adf:ffc1:: with SMTP id x1mr39889861wrs.97.1634646951154; Tue, 19 Oct 2021 05:35:51 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:6dc7:9883:a79c:5be9]) by smtp.gmail.com with ESMTPSA id p18sm15263683wrn.41.2021.10.19.05.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 05:35:50 -0700 (PDT) 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, bristot@redhat.com, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com Cc: Vincent Guittot Subject: [PATCH v3 5/5] sched/fair: cleanup newidle_balance Date: Tue, 19 Oct 2021 14:35:37 +0200 Message-Id: <20211019123537.17146-6-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211019123537.17146-1-vincent.guittot@linaro.org> References: <20211019123537.17146-1-vincent.guittot@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org update_next_balance() uses sd->last_balance which is not modified by load_balance() so we can merge the 2 calls in one place. No functional change Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 57eae0ebc492..13950beb01a2 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10916,10 +10916,10 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) int continue_balancing = 1; u64 domain_cost; - if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost) { - update_next_balance(sd, &next_balance); + update_next_balance(sd, &next_balance); + + if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost) break; - } if (sd->flags & SD_BALANCE_NEWIDLE) { @@ -10935,8 +10935,6 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) t0 = t1; } - update_next_balance(sd, &next_balance); - /* * Stop searching for tasks to pull if there are * now runnable tasks on this rq. -- 2.17.1