Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp914685pxb; Wed, 3 Mar 2021 20:53:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwX67gojRV3uRsOeqMvkVrlTvg9yN0slCba2DvYQg5biRdVzZwj6QM6AdbQYCepPgbG1+AZ X-Received: by 2002:a17:906:9515:: with SMTP id u21mr2342511ejx.86.1614833633583; Wed, 03 Mar 2021 20:53:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614833633; cv=none; d=google.com; s=arc-20160816; b=nppA4X92L/k6Qc96I3Ky4yhzyaRx/zI1vnP7R7IzbKL60NTx4NCMmujKSAqNRXo14K l/j+aDuMO/z7aLSJziGCvhfe7rIqUeVdoHpFrUHl0C/GUvkXl9gbn/OBTP8XYkJFfKRY by6cyanU+hl3u4mMHkR8nFssy77Uwo0bXTM7Y82AzAXlCv72v6UKasfjEz7550JQUiCz sr86KNXsZNKUmsrmOgNiB+pb11CcO4kBDjKd6QCQhzZwbOiHuwNACN/4m6M10j54bHZY 0Warz+oD0Av+nV4ICCaoWZWZNoOK/Pd0GvWG1vsmXcRmBdz8xXA+7uP8jtyNxY3qBMNI fBJg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qshvmYsKDd0OwrveUS4bErr8E0l+P04nshRc4wbCLEw=; b=LsSACaOHU2hB3GF5yaB/EnJ983g0+4tirLyECCItXpCRu/uzLa8vWNXWBSFGjzUBB6 C9uSdQQ+p+dGC9PYAVkV0eRbhx+eMqK+sMoOtYMqup1k6U8GEqPJthNj+gENJazLOI1S dUzLxtumOdEnAcsam93lJONiaxIVn2S4nvauJsmbc+7cQa5IPZO5Z1pVxF9Y7DUpQRCm 1yJSwXYDuZcrtkxtZH2OnA5GPn9InGm47kBSGTFas6IWjaBzPp2f0KDbIUp3PxStnOPr Cfgt15bN8m+Zuq89jcN3dWlSaMqru3qehg5IQ1+0A6xW8QHmqawc7NiTpWj7E3/3v5j0 tgjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VfZWMD6s; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si19073953edz.362.2021.03.03.20.53.31; Wed, 03 Mar 2021 20:53:53 -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=@linuxfoundation.org header.s=korg header.b=VfZWMD6s; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442326AbhCBCMZ (ORCPT + 99 others); Mon, 1 Mar 2021 21:12:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:53010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241746AbhCATix (ORCPT ); Mon, 1 Mar 2021 14:38:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2EA265024; Mon, 1 Mar 2021 17:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618805; bh=LnrRwunVVuJN7kpAjRecKWe5vL2hsaQBUSt4wEzMUnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VfZWMD6s5IAnG41RDKLA3yTjfjgsxpavmNHcErXvg7OOdacKSt7qU4Owknrr889oZ kHOekadtciQVky7AQ+/7oQ7Z3uBoKwNLunQfSFcKbZd5vJRug5GvrYrYFNKHJTExNH l0ciPVnhRVpvBJSiptBAA6RrQTIlF/fspd6r6530= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qais Yousef , "Peter Zijlstra (Intel)" , Quentin Perret , Valentin Schneider , Sasha Levin Subject: [PATCH 5.10 196/663] sched/eas: Dont update misfit status if the task is pinned Date: Mon, 1 Mar 2021 17:07:24 +0100 Message-Id: <20210301161151.479380154@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qais Yousef [ Upstream commit 0ae78eec8aa64e645866e75005162603a77a0f49 ] 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Quentin Perret Acked-by: Valentin Schneider Link: https://lkml.kernel.org/r/20210119120755.2425264-1-qais.yousef@arm.com Signed-off-by: Sasha Levin --- 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 f3a1b7ac4458b..3486053060276 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4049,7 +4049,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.27.0