Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6902635ybf; Fri, 6 Mar 2020 06:44:38 -0800 (PST) X-Google-Smtp-Source: ADFU+vvDjfSKuGxMllIWD7fUsX6YgULsSzO/nbQqtl9WHWukyJ2W4yVFrFLPSiuNWJOcpZwVScKM X-Received: by 2002:a9d:77d7:: with SMTP id w23mr2691405otl.45.1583505878562; Fri, 06 Mar 2020 06:44:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583505878; cv=none; d=google.com; s=arc-20160816; b=xOJNB/HahHePCxhx057UkpFzGT3Q1Elk1qhkJC7NKzKlJBcJ/wqyCQyXfls0WDmrOV 6K0vp/87GV5XQCsSU8FzyvqpVTdWNs6ln0GBSqxffbhgU3j/Bv9Wetu4aUKV0EMU76OU rJKdD0UTZM6Dlais9Yd1gDpchfxGXQPHqtw5OHGt4ILG4NpZv81fRpFu2Tkl9v0vUAOV tPdcyrEheQlf7CSXqoCpSulgAs9VXIyTCJN+F34wYc+BEPTwJRD07tBOTJWizva/YRWd NMlqZTvHvhLXg2KqYyF4uGtsbb/2cHP4f0KtENS6u1ylN3ug7IpPRh5mrTBeeXEBY6SD 6yqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=I1zy9aCgZ6IBbMEvwHIC9i2ZROSfD8aF3EbtuuVUfeY=; b=IUE8gKklKThT4ycKHwYqJMlqR9Ju/4Qc2XUYa9KWV1P9Q3vxSRneIesnwgUe6SBuNU mDp75Ge0U9oumiaYQXdPLNsAGwhKshvKZ1yfpW/4cUV1IqIHS6WO9rr9gmrcbb16d1BX 8xSw2gb40Ol+56+sNe2ndtO2oOJooII6Q+2KInokx+XaOObbXRjrUOR5h2MBv9rRHLkh 2yHYJRvNfJPZW68KNmWojVOqIOyF6YeuCiXeu4OmJLsBuSbd0Mssb6YLp0aglVw5puVo ZSZl+Pm2cv+2ZNqMiSp7MpK5idgxThLgaab7fAuEqdGqLA/i/bL/EAshHiVy6YBK4AR/ 4BHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si1481868oig.197.2020.03.06.06.44.26; Fri, 06 Mar 2020 06:44:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727218AbgCFOnl (ORCPT + 99 others); Fri, 6 Mar 2020 09:43:41 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53769 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727059AbgCFOmO (ORCPT ); Fri, 6 Mar 2020 09:42:14 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jAEAw-0006Ho-Gy; Fri, 06 Mar 2020 15:42:06 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 21CF91C21D6; Fri, 6 Mar 2020 15:42:05 +0100 (CET) Date: Fri, 06 Mar 2020 14:42:04 -0000 From: "tip-bot2 for Qais Yousef" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/rt: Re-instate old behavior in select_task_rq_rt() Cc: Pavan Kondeti , Qais Yousef , "Peter Zijlstra (Intel)" , Ingo Molnar , x86 , LKML In-Reply-To: <20200302132721.8353-3-qais.yousef@arm.com> References: <20200302132721.8353-3-qais.yousef@arm.com> MIME-Version: 1.0 Message-ID: <158350572487.28353.5061886185700456995.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org 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: b28bc1e002c23ff8a4999c4a2fb1d4d412bc6f5e Gitweb: https://git.kernel.org/tip/b28bc1e002c23ff8a4999c4a2fb1d4d412bc6f5e Author: Qais Yousef AuthorDate: Mon, 02 Mar 2020 13:27:17 Committer: Ingo Molnar CommitterDate: Fri, 06 Mar 2020 12:57:27 +01:00 sched/rt: Re-instate old behavior in select_task_rq_rt() When RT Capacity Aware support was added, the logic in select_task_rq_rt was modified to force a search for a fitting CPU if the task currently doesn't run on one. But if the search failed, and the search was only triggered to fulfill the fitness request; we could end up selecting a new CPU unnecessarily. Fix this and re-instate the original behavior by ensuring we bail out in that case. This behavior change only affected asymmetric systems that are using util_clamp to implement capacity aware. None asymmetric systems weren't affected. LINK: https://lore.kernel.org/lkml/20200218041620.GD28029@codeaurora.org/ Reported-by: Pavan Kondeti Signed-off-by: Qais Yousef Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Fixes: 804d402fb6f6 ("sched/rt: Make RT capacity-aware") Link: https://lkml.kernel.org/r/20200302132721.8353-3-qais.yousef@arm.com --- kernel/sched/rt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 55a4a50..f0071fa 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1475,6 +1475,13 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) int target = find_lowest_rq(p); /* + * Bail out if we were forcing a migration to find a better + * fitting CPU but our search failed. + */ + if (!test && target != -1 && !rt_task_fits_capacity(p, target)) + goto out_unlock; + + /* * Don't bother moving it if the destination CPU is * not running a lower priority task. */ @@ -1482,6 +1489,8 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) p->prio < cpu_rq(target)->rt.highest_prio.curr) cpu = target; } + +out_unlock: rcu_read_unlock(); out: