Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2727356pxb; Tue, 19 Jan 2021 04:47:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF9G8T8g9+/DFV4TM2iIYjnhN+v1JGNzquWGNAQTP3tFFgA3+WskHnqqBwsAO75jdja5bV X-Received: by 2002:a05:6402:70f:: with SMTP id w15mr3377144edx.121.1611060443847; Tue, 19 Jan 2021 04:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611060443; cv=none; d=google.com; s=arc-20160816; b=eX7I2btWiHXzYjwdDJqI8HjXEVQNgZDCFhFb1CrNayRW7jI0ZFWXmaCOq29o5wnq++ ZXMWDCw4OmN/8bvWVGJuGT8q9sV8GPAIW7027CNoyCt1fg4QTkB417qOiDviRzjpb/+3 r0xzgZ5Swhao175joeb4y8nVdud3fjIPC5kI9XWCnadSsACXZhqabDrXeWp+oN1H5r8R 8Fk9ETfcCokLF/fQ72M+DTVmyK0kGE4OuUuouMCFKszK+v3JJoufb7cUuYD7kLRqRlki XMayVZJFHeq9i6yuS2TGpehwSZ+3ok+iWQU9ez0dxg0Rg6+amIn+JrUwA5rZEtlmwZqK iRvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HOkdeEKOKSRW2zH3rTgt1lWqcDOe6ziAedj84fLQ0UQ=; b=V4KYhS0g7snFoHmz3/NMja3ATZyZFiAHhxYB8PhZlRTkvZJy6ZQxdrAcSDnn3EMga3 ROLC3l9HnSbFRRkOOJBoiOY4aoMLakl/jkRtD6P4dSBZXYfvS+OmVn543Xk9czuCaTvY yp8WGJLh0gPKVGeKPpa9qa2/oNKzFNLHWY9i0pLcO73TyQCThFflAazkIgyDhNOWHxDH jMHSZzyz/M69+v4yBWJOJ86v5wGexKa1uAEAxWkX8pUP59nn7+MQx9D5d7gAs4sQfrxu UdQpW/E0YbJ+jKuSA5upEMGRugXVfgBpkpSLdpMkdJNTLweSgcP+fClSGf7wgtpFT2Mz 8qOA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si2339743edy.92.2021.01.19.04.46.58; Tue, 19 Jan 2021 04:47:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392592AbhASMRT (ORCPT + 99 others); Tue, 19 Jan 2021 07:17:19 -0500 Received: from foss.arm.com ([217.140.110.172]:53906 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389776AbhASMI7 (ORCPT ); Tue, 19 Jan 2021 07:08:59 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 14E96113E; Tue, 19 Jan 2021 04:08:13 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (unknown [10.1.194.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 148A13F719; Tue, 19 Jan 2021 04:08:11 -0800 (PST) From: Qais Yousef To: "Peter Zijlstra (Intel)" , Dietmar Eggemann , Vincent Guittot Cc: linux-kernel@vger.kernel.org, Valentin Schneider , Morten Rasmussen , Qais Yousef Subject: [PATCH] sched/eas: Don't update misfit status if the task is pinned Date: Tue, 19 Jan 2021 12:07:55 +0000 Message-Id: <20210119120755.2425264-1-qais.yousef@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the task is pinned to a cpu, setting the misfit status means that we'll unnecessarily continuously attempt to migrate the task but fail. This continuous failure will cause the balance_interval to increase to a high value, and eventually cause unnecessary significant delays in balancing the system when real imbalance happens. Caught while testing uclamp where rt-app calibration loop was pinned to cpu 0, shortly after which we spawn another task with high util_clamp value. The task was failing to migrate after over 40ms of runtime due to balance_interval unnecessary expanded to a very high value from the calibration loop. Not done here, but it could be useful to extend the check for pinning to verify that the affinity of the task has a cpu that fits. We could end up in a similar situation otherwise. Fixes: 3b1baa6496e6 ("sched/fair: Add 'group_misfit_task' load-balance type") Signed-off-by: Qais Yousef --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 197a51473e0c..9379a481dd8c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4060,7 +4060,7 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) if (!static_branch_unlikely(&sched_asym_cpucapacity)) return; - if (!p) { + if (!p || p->nr_cpus_allowed == 1) { rq->misfit_task_load = 0; return; } -- 2.25.1