Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp403446pxb; Sat, 6 Mar 2021 03:45:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfjq70yUTExgo5Dwft32c5REvDYHO+muWVcoJGi7GQ8I4o2r9fx8vnTLsM3sGlxQl2x062 X-Received: by 2002:a50:d9cc:: with SMTP id x12mr13694153edj.68.1615031110642; Sat, 06 Mar 2021 03:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615031110; cv=none; d=google.com; s=arc-20160816; b=pNZ5qP3Ono7h0x2i9eokIfNfFdbZX1HVyToFyM0b/wIUPHPbYEs2fiSuEfBiUZRYhH Sx7VJAJ3t9TYW/bT7yl0jdQW6glByJPWYb/FOrxCE/iGru7IxoAcn1cdq9q1sdIo+J9Z fq3V3oDLKV5hkpRLWtEmL0IIDb91rSncn65oCVecg1MgcApzCJYRPyFcvr+4myoU0MGP TU/Mv3Mh0PeKWwLiP7eNabmJwnVILUzuP8GB68rYOHTguB1wbuAj7GDF1IAD5ovQdR+f hXpLIafwzHyuSzM6wNrJgdwYUPiagObK86/aABgFMFcayLWoVRJPL272Hdzz1xGHfht3 pErw== 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=UIh5zI39+NIOw32Y3JJaYjSM+fiwLYqsQQ58NGt37TE=; b=oigEbHmWrBejDEXiKrX36dk1oJST3tsJeZVk+cSUp+sjD3IHvVEqhB+Hnf2n69GJmu WuCZrcWhb0KYBgzWWSTcFFrBDkMXsiiCII1w2/bt5nSTPZRpGkp4fQhDre0ImZtGz3qw Wceqt0rVVmKBz1W0YmEPH99QMjeHURjY1jx7olEi5YxJ/RJGalVNwEXUJW2kGlfzB1kB xVd/eXQ7nA7xxXgpP3RfIKqhuDUoo/kmZdRB/xXmVdxQpoD6mDRGuOWb/ZFmUQby4Yxp BaFDAe+VzoCVFHTJbeNUtEXuwOu/6n53jU1NvTTCa+H4wL76KjzYMXkWxL81VX+FCtfG tssw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Xc1qmguz; dkim=neutral (no key) header.i=@linutronix.de; 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 g3si3326837edp.527.2021.03.06.03.44.48; Sat, 06 Mar 2021 03:45:10 -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=Xc1qmguz; dkim=neutral (no key) header.i=@linutronix.de; 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 S231307AbhCFLmt (ORCPT + 99 others); Sat, 6 Mar 2021 06:42:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbhCFLmZ (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 174CDC061761; Sat, 6 Mar 2021 03:42:25 -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=UIh5zI39+NIOw32Y3JJaYjSM+fiwLYqsQQ58NGt37TE=; b=Xc1qmguzuyYg/pJqbGdjbVbl9m7UNJaD16koFiv3rd+P0xDoWpVMp2WFXtA/VA1MfXs0Sp CSfGjv07Fsdcivtvtzt9aQQ1Us7ayDQ4W8sBtGjRQqOvXCTop/WzD0mbNo3KhV7/q4jI0I mrNLrTHHLkz7FOuhrEB6BgAy8awToDeE8+3lwpKkVsrKz0FfhBl4P7QxiAiBWARQ70q6Zz hVxFkutfaeDNXxbnTLubuWEwOt0FjxJoiJD91OFdwzMZbGAhXnYXqYWtr2DlV33+AemVsP 1Q/iJ+ezgaJkodB1rOEN4f8MptCWbjoFHLYagZMoM8FvVEUSXjoQ77pVfRBLjw== 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=UIh5zI39+NIOw32Y3JJaYjSM+fiwLYqsQQ58NGt37TE=; b=P3wyrVXRby0smYtAjzQLRwvx/S9sW+CpKFtlwft9yFO8VOOlmuxa6u7zBLwvJY+wabgV+C 3aLLxIl4B0tvM4BA== 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: Merge for each idle cpu loop of ILB Cc: Vincent Guittot , "Peter Zijlstra (Intel)" , Ingo Molnar , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210224133007.28644-5-vincent.guittot@linaro.org> References: <20210224133007.28644-5-vincent.guittot@linaro.org> MIME-Version: 1.0 Message-ID: <161503094273.398.9888109853630120461.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: 7a82e5f52a3506bc35a4dc04d53ad2c9daf82e7f Gitweb: https://git.kernel.org/tip/7a82e5f52a3506bc35a4dc04d53ad2c9daf82e7f Author: Vincent Guittot AuthorDate: Wed, 24 Feb 2021 14:30:04 +01:00 Committer: Ingo Molnar CommitterDate: Sat, 06 Mar 2021 12:40:21 +01:00 sched/fair: Merge for each idle cpu loop of ILB Remove the specific case for handling this_cpu outside for_each_cpu() loop when running ILB. Instead we use for_each_cpu_wrap() and start with the next cpu after this_cpu so we will continue to finish with this_cpu. update_nohz_stats() is now used for this_cpu too and will prevents unnecessary update. We don't need a special case for handling the update of nohz.next_balance for this_cpu anymore because it is now handled by the loop like others. 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-5-vincent.guittot@linaro.org --- kernel/sched/fair.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1b91030..3c00918 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10043,22 +10043,9 @@ out: * When the cpu is attached to null domain for ex, it will not be * updated. */ - if (likely(update_next_balance)) { + if (likely(update_next_balance)) rq->next_balance = next_balance; -#ifdef CONFIG_NO_HZ_COMMON - /* - * If this CPU has been elected to perform the nohz idle - * balance. Other idle CPUs have already rebalanced with - * nohz_idle_balance() and nohz.next_balance has been - * updated accordingly. This CPU is now running the idle load - * balance for itself and we need to update the - * nohz.next_balance accordingly. - */ - if ((idle == CPU_IDLE) && time_after(nohz.next_balance, rq->next_balance)) - nohz.next_balance = rq->next_balance; -#endif - } } static inline int on_null_domain(struct rq *rq) @@ -10385,8 +10372,12 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags, */ smp_mb(); - for_each_cpu(balance_cpu, nohz.idle_cpus_mask) { - if (balance_cpu == this_cpu || !idle_cpu(balance_cpu)) + /* + * Start with the next CPU after this_cpu so we will end with this_cpu and let a + * chance for other idle cpu to pull load. + */ + for_each_cpu_wrap(balance_cpu, nohz.idle_cpus_mask, this_cpu+1) { + if (!idle_cpu(balance_cpu)) continue; /* @@ -10432,15 +10423,6 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags, if (likely(update_next_balance)) nohz.next_balance = next_balance; - /* Newly idle CPU doesn't need an update */ - if (idle != CPU_NEWLY_IDLE) { - update_blocked_averages(this_cpu); - has_blocked_load |= this_rq->has_blocked_load; - } - - if (flags & NOHZ_BALANCE_KICK) - rebalance_domains(this_rq, CPU_IDLE); - WRITE_ONCE(nohz.next_blocked, now + msecs_to_jiffies(LOAD_AVG_PERIOD));