Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3159820pxb; Tue, 20 Apr 2021 01:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr7FKHqEeSE55rUeyCmMdlMaK7AVa2mBedp5UukDtv1dUI+0Rn2AJcJCMc+79ATPfdt4rN X-Received: by 2002:a63:b00b:: with SMTP id h11mr15541490pgf.204.1618908439028; Tue, 20 Apr 2021 01:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618908439; cv=none; d=google.com; s=arc-20160816; b=OCPlqBN5j4vp0NWlJDr/cMX6GRyhkLLCJmeIJUsLvV83ZciDcR0k/gnbOiRhriFPVq LgvvQ2u+ZKy8uyKUPgPi9F4PKSB3fmssFVvRJTS7RELSH05QzoMls/pxu2viwOhTZOKA 8lXp1xMU3kAxm6Ry0G1phCID8qfXl639LJiAGG/Lx0C1u5bIEqQje4laQiZ4tCzUEF9W aXqVsnYE9l2JKYOoC40y1VADMBo1t9hS7NrJioAf1G0wdRJAABArxR8X5aD0viln0xA5 Kul00+eNDVupxLYy4w4fJ+xadApWb26rY+Z13guP5eQSvvK0uLq80snxJyQp0MqgsxT/ UuBA== 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=uuQixnNEBiCNiqwfuVnyZrvDsy6wXRftDK7IKYjxUnI=; b=ePv7z701bqMkxmgo/kzXAmXcpBA/kBPVncURVCQi4OfAhwuV/r2M5MV5CNIr3Nv0Kp hfzVY1xyQTISdEmiuqjEszwaIvcA18dRpw10emRYCoaj1JV/wKV71UJTGJXnv6SHtqBv xAqkamaEEG/gkjWyES/ZRM06iHJQcP3i2tPDzNI//hADTPky8glPSmShxIzjGVwcTMqB V6X0Zdx5tf1NCVBUtX+qK7oh+WDL+2o/YeS9rpQflZx7DJd7HDg7M/GbT0wP02u3cW18 SOb7iGbekxEE0voadzYCClpXWbPpaf0znozzSsUHMtrlERt1gQLkO85gnrh0qKRQMUIp AJFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Cjqngsl+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 a12si11190160pfg.46.2021.04.20.01.47.07; Tue, 20 Apr 2021 01:47:19 -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=@linutronix.de header.s=2020 header.b=Cjqngsl+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S230447AbhDTIqt (ORCPT + 99 others); Tue, 20 Apr 2021 04:46:49 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51042 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230395AbhDTIqs (ORCPT ); Tue, 20 Apr 2021 04:46:48 -0400 Date: Tue, 20 Apr 2021 08:46:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1618908376; 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=uuQixnNEBiCNiqwfuVnyZrvDsy6wXRftDK7IKYjxUnI=; b=Cjqngsl++da7k9RbP0aGTQsolZXDJTW97aIR3B17pxuNY/KH7RH66iuVFf64wp7srJ3aic at4TUofs/y2H6y1W2ujpnEGPAN4VyqULiOiwBD8jXbWGUwyuMxtJBStH5Z1gz8aI8Sx7vR XFQGv+HaCOMZoHKcERksAAaWWG6QNnwjxeb8xAGC2qb0YGaHsP/6A5wptqMoLCNEpVEtzs eO+3gS2nrsZRj1F/+6EPtwiKmB07la5Y9VTey/DOe0WeBn16gXZbYFlRa0PpMymbdsdE2z 1dx6Fpfds5Ue217SpoBUvbsbN8Sf90MVLZuKTdqKQWEp5Id/ItzGlzCiepiThg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1618908376; 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=uuQixnNEBiCNiqwfuVnyZrvDsy6wXRftDK7IKYjxUnI=; b=0CqVaCeyHteop9JNkBVozRyDsvFug00WL5qAh5JQzejSd0KsA41X9MK7q7mGkykWPYSHpl GHhhZ6CXD7Hm16Ag== From: "tip-bot2 for YueHaibing" 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: Move update_nohz_stats() to the CONFIG_NO_HZ_COMMON block to simplify the code & fix an unused function warning Cc: YueHaibing , Ingo Molnar , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210329144029.29200-1-yuehaibing@huawei.com> References: <20210329144029.29200-1-yuehaibing@huawei.com> MIME-Version: 1.0 Message-ID: <161890837554.29796.9442405099846421634.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: quoted-printable 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: 3f5ad91488e813026f8c5f46b839e91a83912703 Gitweb: https://git.kernel.org/tip/3f5ad91488e813026f8c5f46b839e91a839= 12703 Author: YueHaibing AuthorDate: Mon, 29 Mar 2021 22:40:29 +08:00 Committer: Ingo Molnar CommitterDate: Tue, 20 Apr 2021 10:14:15 +02:00 sched/fair: Move update_nohz_stats() to the CONFIG_NO_HZ_COMMON block to simp= lify the code & fix an unused function warning When !CONFIG_NO_HZ_COMMON we get this new GCC warning: kernel/sched/fair.c:8398:13: warning: =E2=80=98update_nohz_stats=E2=80=99 = defined but not used [-Wunused-function] Move update_nohz_stats() to an already existing CONFIG_NO_HZ_COMMON #ifdef block. Beyond fixing the GCC warning, this also simplifies the update_nohz_stats() f= unction. [ mingo: Rewrote the changelog. ] Fixes: 0826530de3cb ("sched/fair: Remove update of blocked load from newidle_= balance") Signed-off-by: YueHaibing Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20210329144029.29200-1-yuehaibing@huawei.com --- kernel/sched/fair.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 49636a4..7ea3b93 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8430,28 +8430,6 @@ group_type group_classify(unsigned int imbalance_pct, return group_has_spare; } =20 -static bool update_nohz_stats(struct rq *rq) -{ -#ifdef CONFIG_NO_HZ_COMMON - unsigned int cpu =3D rq->cpu; - - if (!rq->has_blocked_load) - return false; - - if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) - return false; - - if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) - return true; - - update_blocked_averages(cpu); - - return rq->has_blocked_load; -#else - return false; -#endif -} - /** * update_sg_lb_stats - Update sched_group's statistics for load balancing. * @env: The load balancing environment. @@ -10406,6 +10384,24 @@ out: WRITE_ONCE(nohz.has_blocked, 1); } =20 +static bool update_nohz_stats(struct rq *rq) +{ + unsigned int cpu =3D rq->cpu; + + if (!rq->has_blocked_load) + return false; + + if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) + return false; + + if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) + return true; + + update_blocked_averages(cpu); + + return rq->has_blocked_load; +} + /* * Internal function that runs load balance for all idle cpus. The load bala= nce * can be a simple update of blocked load or a complete load balance with