Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3608031pxb; Mon, 24 Jan 2022 13:24:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiwJOKhN9aWyLbQbw+EHUdpxlvNzkT+coLlSwGD+kpDAm6/qO+CtZZZnFw6p5sv+ZFOVcz X-Received: by 2002:a17:90a:d585:: with SMTP id v5mr252076pju.124.1643059495456; Mon, 24 Jan 2022 13:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059495; cv=none; d=google.com; s=arc-20160816; b=lX/u8qr/IxSChTbDYIy5vZpB5A9dG95pxoP9sIDHMa3jLS2IIKqmfvuNSvU/+7wrLT 4rMLyZJ/irSPuyTRHu71pxa/MwG5hqcZypxOtR3DI0p3q+5Qjh0Se4is/cFDmjRzda1N 9SX8XcDUHIvLVgalOciswszuAYCKcfAdd5zZSDSLJPsPVGeAE5onUQ+DcVq0fH9QeDOp 5UklsKzEz0Bu6lwNzSQPqO663Ei38/mMfNUsAgKWxqSXork+PfpAVVN4L+4ZzLeDNLLx nAUukP0egFkrXGmTwACCr3t/+nco2KxPRWUe97aoVc/McMaUPlXxcHCywSEJwZi6uFiB utvg== 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=GTsKVqSppf1tHy++oFvjY0bTLAfqySu5fafYE/2H7U0=; b=JHhEVrQGUWPfdVogF6+n2abCM3seE94sKfVqVWfZMBHHKjOGHjESYeyMvqFzi8rkJY UQwJ/E/9SWviOzuvOYX7uIoXSt1Ev3nHxYImS7Vz0kYVPp03OMgDlVxVMjFFTzAyq8hd AtrNw3ja6h1GWhePEApBxTkbjHrPxCqqE+1R293VRnPrmp1GB6/fXwQvF4dNr4EtVdQU FVVPtOYFv/PcPaFPEskgU/mNGPdyogDsM4OWCH24z2Y/Sk9D5sMFgtZ6bROqO8uQcwrL eJXmydw7Mhd29HfEpHT1SgZ+9J0nDQE4oPGRtLVtBnZ8EYup6TeFL1rPq5P9VJulZn8J 4lXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=izDFkG76; 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 n9si12951556plk.379.2022.01.24.13.24.43; Mon, 24 Jan 2022 13:24:55 -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=izDFkG76; 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 S1443382AbiAXU4r (ORCPT + 99 others); Mon, 24 Jan 2022 15:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345513AbiAXUeT (ORCPT ); Mon, 24 Jan 2022 15:34:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5453C07E2B4; Mon, 24 Jan 2022 11:47:42 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9BDE7B811FB; Mon, 24 Jan 2022 19:47:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1E04C340E5; Mon, 24 Jan 2022 19:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643053660; bh=dKB+66OEFYLtY2vwiuFxKSq1TWOn9R5HhTm/Y3CAfr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izDFkG76I3zTbg+mc/rLPGSR2EwHESwlZttb0cL3tEHFX6cvCyzD1BKwpxg3c423I NMoKrYq4flAoPspGu0JxGvkKYYMT5AWxZtAUhOW2mHXaGGpuVkayfAwK/ac5m1A/re kMa5rKKi9521l+mzaosrjbyao0thAnMbe3Sk6VgE= 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.10 135/563] sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity Date: Mon, 24 Jan 2022 19:38:20 +0100 Message-Id: <20220124184029.069413824@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184024.407936072@linuxfoundation.org> References: <20220124184024.407936072@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 a7589552be5fc..2a33cb5a10e59 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6286,7 +6286,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