Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3983243pxb; Tue, 25 Jan 2022 00:38:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLZVogX6TklUXpY9qEiln5oSpRFMVOh1qCo+6qDNrgxA7GtgQ5P4iGwLIq0alnlm+D5m17 X-Received: by 2002:a17:906:9b87:: with SMTP id dd7mr15230131ejc.126.1643099926820; Tue, 25 Jan 2022 00:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099926; cv=none; d=google.com; s=arc-20160816; b=b05fYio8axYT9HqgjLRWbQv1BCUa7f+rKrxTFHmQFpGtZIUnjj11JBE+BD8pZ6nEDp 4GvjUin1SqENdfAzxAdMZ01TENONkn3odfbUomLm4JkMTNfdmvWixGBp1G2S3A5ieURP QNMLTAqs1YGlK1dAfmK2wgD9EPxUXtJnCTuZcTsHi5HqLvCSknz1SgTxS2DQZ6Y8+2FJ qBiEJzIY3Nu1yey+jUgA9Rj+o6ByD+ounYBWt1KkBgh/5wta9DInc04Bf4Fvzf4Sy/4a aH0NMVLEcCPMmkemF8Ez3Bf62uDap1Mt+z8MGBc3cLyuM/iPTKAfGXXU3LAEj7qLmMgd vjmA== 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=ktAwo3S4hX/N3aowmeM4kQ9LqeuyjGW8qMY6nHZmRCI=; b=T9s6Q3pCAVnR7xTMc8o+Hx74H6hmg+Je05TZ3JJipotSZsrx/O+Cbc7RiulHGiIErg epzWVEDjvQKv6omZjab6P1RQJxxmLEtVntQf5CU3Ao2sZCYWKwyf4dUvJodFt9KQb5P0 CH1j8bmECNT1qJydPLAF24e6wmQ5kMUdP3ibfl6v6hSDmsjcZFWvCwcbnIv4RGDCzKkv f3HHIYarKeNc8qaJUSMUybrZRpjTffLAICnuwvevFF5JeopYUtPJ3zpw/NhAkT17pgfm wJ4QNcCJUSC2eL2YxrPVSQyAAZmlECAf6bdUL+LVPGprcErkcBXlL1Uzv1k5NpbQHUx9 9sMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1tb/cMOB"; 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 e26si8667986edr.119.2022.01.25.00.38.22; Tue, 25 Jan 2022 00:38:46 -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="1tb/cMOB"; 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 S1314989AbiAYCwM (ORCPT + 99 others); Mon, 24 Jan 2022 21:52:12 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:56130 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446008AbiAXVGA (ORCPT ); Mon, 24 Jan 2022 16:06:00 -0500 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 15B2860C60; Mon, 24 Jan 2022 21:05:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07DADC340E7; Mon, 24 Jan 2022 21:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058358; bh=/DgqTbH+xxPRtgjYWV9bVu1oAOUCw0uXfaKZbOLN0uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1tb/cMOBS2cLfycTf7I6+zENmeyBFQ3E1+OFzEGZRzvdPBAYU/uAPCKn1zDMnj0Yq mWEmbwEz47PPImVHUdO4pFVw4XQgg2JGz2aB7s3Kug67oyTxfZGdwWGd6ACUKzqhXs Hcr235m7Yy+wa2MtkCVLok7ZgOUw+isWx+H7wQ/U= 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.16 0231/1039] sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity Date: Mon, 24 Jan 2022 19:33:40 +0100 Message-Id: <20220124184133.084799295@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 97d89516fbea2..f2cf047b25e56 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6400,7 +6400,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