Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3654881pxb; Mon, 24 Jan 2022 14:33:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSIugjO0bc3lowFX1djL5sax8xVe3g4S80YnJ2YlITgZYulcfL2nTCe69Vq1lqGU9Wh+5Q X-Received: by 2002:a63:d2:: with SMTP id 201mr13501824pga.56.1643063471598; Mon, 24 Jan 2022 14:31:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063471; cv=none; d=google.com; s=arc-20160816; b=DPJXCBOjxulYMdxnz0eTowql0JXdjq+6C8Y3vmmTo5AZaltQTcHCXxtJ+yeWMGwsjD ZxDGLufMMs5Ww/pdVfm1D9pCc46ZBlI5bEiBRTXf0YKI5OiwL+Ow/om68boyuZcLnEIv tqR5DnxFae6mXFRpp/m/3/6lbhLqrPsAOVZihxGjdkMPzbJF5X8f+WYVeAT7ENXrzFhZ uCmjA84iUUkuCitgqxn8d9fJH6798i0AH0rYFYeoieKCNxxOOFkOQfdcMuly+psZ9d10 H5KG6A4rarlqQpc29az4fgIPM4Dgn9mwR96ZsltwyvAaQ6SM5Cf92oEKyISgi8Yxs8ud mVrQ== 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=v9U0eVJF/cEos/zFunGOYVQ1LtWyKH5RC+yOFQuYMFc=; b=uUza1NRcLJ8Tm8Wv4NyQjIqpSiuAJwvjKG1+/VioblMoGF0EWYz2JCF0+pHOHM1G6I 2vamZds59ZJHwrDUrguKrySZFWUyYC/r41CaLAVR3n5EyeTxbfa1goYuT3/mjF4ulQbV Dgc0UM1rEvSzy/+jkeH4Kcxz0Wmnr+QSy2iq81o+eMFkq4tDCCf/8U8ermb7v3gTWOp2 GF+7qGY0p3RMAdMzWYdBtsgfvX5jeq+8EhBPZ/zIKuQ00CS/JpCKDx42DOI+ApPW+2Um b+F8Q3Tt0miO0vI341rUOSIckNDeZy8fCcaAg/iy+6br+UOlgm0Xb5+sqm2n8YbKkzme IXRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OoSpB1Ti; 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 x22si13794127pll.382.2022.01.24.14.30.59; Mon, 24 Jan 2022 14:31:11 -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=OoSpB1Ti; 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 S1586453AbiAXW0e (ORCPT + 99 others); Mon, 24 Jan 2022 17:26:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1453881AbiAXVbI (ORCPT ); Mon, 24 Jan 2022 16:31:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35349C0AD1A7; Mon, 24 Jan 2022 12:19:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C656C611CD; Mon, 24 Jan 2022 20:19:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35B77C340E5; Mon, 24 Jan 2022 20:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055586; bh=OUU0ni4RrGf06bexgTK8WS2wIiGIBZIlooOZq1StkTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OoSpB1TiuN1fQHnYH+whVOB5+XxQ1YoXZi+jXCeYRhZkWlNmuQF8ivWj0eQftbSVL N8gW5P2QtFo+YEdkwWUt4ZQuBzatGh/2FZ9JcAP0pKLgueG6deoDoEBBoFZvVtP4nB BKGiP6dc42rtrEgkgIbJq+kcDRcw93jecNFYOU5U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Donnefort , "Peter Zijlstra (Intel)" , Valentin Schneider , Dietmar Eggemann , Sasha Levin Subject: [PATCH 5.15 200/846] sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity Date: Mon, 24 Jan 2022 19:35:17 +0100 Message-Id: <20220124184107.835018014@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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: Vincent Donnefort [ Upstream commit 014ba44e8184e1acf93e0cbb7089ee847802f8f0 ] select_idle_sibling() has a special case for tasks woken up by a per-CPU kthread where the selected CPU is the previous one. For asymmetric CPU capacity systems, the assumption was that the wakee couldn't have a bigger utilization during task placement than it used to have during the last activation. That was not considering uclamp.min which can completely change between two task activations and as a consequence mandates the fitness criterion asym_fits_capacity(), even for the exit path described above. Fixes: b4c9c9f15649 ("sched/fair: Prefer prev cpu in asymmetric wakeup path") Signed-off-by: Vincent Donnefort Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/20211129173115.4006346-1-vincent.donnefort@arm.com Signed-off-by: Sasha Levin --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c6cb8832796b5..d41f966f5866a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6431,7 +6431,8 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) if (is_per_cpu_kthread(current) && in_task() && prev == smp_processor_id() && - this_rq()->nr_running <= 1) { + this_rq()->nr_running <= 1 && + asym_fits_capacity(task_util, prev)) { return prev; } -- 2.34.1