Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2559243lqp; Mon, 25 Mar 2024 02:34:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUV6P2AR7PvxgJH4uTr1Yo7fC9e9k744OMZS01H6aaoOVnOmT0EJWvMU16IP+MCOnJRACp5XbFnVo6Sr1jSQ39SsBd9+XgD87aEZhSsrQ== X-Google-Smtp-Source: AGHT+IHEuEmuZ4E01ulmVumqwD2ym6J+NBnrS+kxbMBsUIFAXY8xWK2TEJW+J7Uk4p+pJRm/JKoB X-Received: by 2002:a50:8e1c:0:b0:567:800c:f6c6 with SMTP id 28-20020a508e1c000000b00567800cf6c6mr4977036edw.15.1711359263269; Mon, 25 Mar 2024 02:34:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711359263; cv=pass; d=google.com; s=arc-20160816; b=edkme5ctco2199ZFQnvf+I1NHJeAgJns3KBrtPd4CjzrngV6ALkrszDP2tAbpeovGQ Uv9jKQZnEqJkorz/qLA2WsMmoNz6wkBPa1h2TLSDbZyomFATmrIp0sF1nP++QkQuwjYj pQIv3edb3FC/WoFK2kAFfCXzPQTumWiyT7ert/acX4/WSWkXlH/eacYtoTWkzHqYzpEg Q2VKZICwv7q9VdVAGXjZ/j9/hjEvrIN70thk1jeML2ViYwjHLdA4oD1T/LFswE5NgZ+J QGE7peQZl81JnEUeAAPME6E+jXsKisQWZlT3XSHymKWT61TL8YM4N69BpQNUhBz7ehRX yMvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Fc8sKixVqrbWDq0fSp8uAGjnNNfdFLTXdIhHneLq6iI=; fh=r2ks6oCyUhFJ8De+x85SflMEYTLSKj0sjIF3YoYf3fg=; b=uMBtHN1vfHm5bTy7VmMRowRRlQ4j1Kq6a9EScP/YjKVi1jFaMeCNL5ydXNYBXvF3Mq WEKZhvT0VI+xPZiu/GQ+0H+T5nhy2UT7rYcqx0/WE4+LAJ4IlRNMjT+X7Cw6/9PRHY95 yhUXVL88vtj0wfpkCd2TW49yK6pU+yuowWgNVdfVhufyPSPP6LtiXubOdhGqPzd7SxkO ygW6aRtzWGyz2FpMc7RCn/lH87SsJyhpDcqxou4/pJpoMlrg+ReT8+kQ4Hn2KpDSjgeV YeOv40qrUfRH26DD7dv0Y6KtLSn8rvbKOuD6Nz7RCdn3SbgRE1XSs+vykpkacMq2cYqv yIZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f5t+iOmU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ek6-20020a056402370600b0056c05c5ff27si1486370edb.206.2024.03.25.02.34.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:34:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f5t+iOmU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C26181F31CD2 for ; Mon, 25 Mar 2024 09:32:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1481A37BFB6; Mon, 25 Mar 2024 03:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f5t+iOmU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99D1E145B10; Sun, 24 Mar 2024 23:13:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322010; cv=none; b=mL42jcKEPZHqm+lGKTBYTHLjo7SQLR0DUaHOAAo6SILfvkCoSylMPtuGK0HzgLPvltxoVc+ZG0tvVsWRfHqFaB+k4+TlOGfFY30s7BWsW6QK58pXAW22xAmvH0IzXPShvbkBwse6DKs/Q8fGcjsMwBTgasbOjwQ73RuNtzUytSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322010; c=relaxed/simple; bh=3Le8gboUrS+vnAKEn4w7S6zkTVVMr2DoH01QyYPhozs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qPULg/d5Bvb9pYjDYPc/SYlR3ffu3xFqsoHzoGdy+u1MLyS6owJFXsHYXP7VNRp2cLu4OqAoJSs6n9ztj0AovafLQeYPH2Dzl0UgwFr76y/EGJAUbHUKMsEKGuNFZxFgagFwBNsXcV8K3hdKjBf14r3uXyR3stXzxn/0mLfv8lQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f5t+iOmU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE2D0C43399; Sun, 24 Mar 2024 23:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322010; bh=3Le8gboUrS+vnAKEn4w7S6zkTVVMr2DoH01QyYPhozs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5t+iOmUaBpZ5jG7hdDugZ7CdGEJxWwtPcKTK3D0sgcJVeOod3LY5EkJ1yonsjf45 gUZnTCnTFtQhIT3qWu37lCqL7QUk/y5OcNCxe2J7h9JzFXh8716KM9cDE32UJuUSuH V6AVEAJyvPRd25acux6NFCawCf5W27u+FN/fLWqBoMvgBp5/v4VaIbkPOgiJK2k7Nz M9GEcNOI0tO2OKiHoNcTmVD7DuN+aA1KHd7TUy8fVKLgQuS8oAz7ONtyVkepPQJWIK HGI6PBkjhnqv/rpO+IGYh+qtYyVIdd4c3HDnYBx8L96NA3IFOPz04vEvbqLg8dZiKl m+4bAOXpoiqbw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Keisuke Nishimura , Julia Lawall , Ingo Molnar , Sasha Levin Subject: [PATCH 6.1 082/451] sched/fair: Take the scheduling domain into account in select_idle_core() Date: Sun, 24 Mar 2024 19:05:58 -0400 Message-ID: <20240324231207.1351418-83-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Keisuke Nishimura [ Upstream commit 23d04d8c6b8ec339057264659b7834027f3e6a63 ] When picking a CPU on task wakeup, select_idle_core() has to take into account the scheduling domain where the function looks for the CPU. This is because the "isolcpus" kernel command line option can remove CPUs from the domain to isolate them from other SMT siblings. This change replaces the set of CPUs allowed to run the task from p->cpus_ptr by the intersection of p->cpus_ptr and sched_domain_span(sd) which is stored in the 'cpus' argument provided by select_idle_cpu(). Fixes: 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()") Signed-off-by: Keisuke Nishimura Signed-off-by: Julia Lawall Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20240110131707.437301-2-keisuke.nishimura@inria.fr Signed-off-by: Sasha Levin --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1c4e54fffb8b6..91c101ecfef9f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6656,7 +6656,7 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu if (!available_idle_cpu(cpu)) { idle = false; if (*idle_cpu == -1) { - if (sched_idle_cpu(cpu) && cpumask_test_cpu(cpu, p->cpus_ptr)) { + if (sched_idle_cpu(cpu) && cpumask_test_cpu(cpu, cpus)) { *idle_cpu = cpu; break; } @@ -6664,7 +6664,7 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu } break; } - if (*idle_cpu == -1 && cpumask_test_cpu(cpu, p->cpus_ptr)) + if (*idle_cpu == -1 && cpumask_test_cpu(cpu, cpus)) *idle_cpu = cpu; } -- 2.43.0