Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2528554lqp; Mon, 25 Mar 2024 01:14:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8agJVHfRTFGSU/s7YMSVOSVn39koRG4p4ygFyFn86SCNk6l7da2b6nB0rKWlXSI1f8MYWsZxgwwVOuNG5bOdBpAu6ULoSpUVSVs+MGQ== X-Google-Smtp-Source: AGHT+IFQXfGbUQnCKBCc6IKVF3ShXSFqTMiFrtEoqZz2weI+gz/KY5HLA+2qgu49ywgryK0gLaCQ X-Received: by 2002:a50:cd4c:0:b0:567:9fef:f7ee with SMTP id d12-20020a50cd4c000000b005679feff7eemr4366631edj.16.1711354493881; Mon, 25 Mar 2024 01:14:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711354493; cv=pass; d=google.com; s=arc-20160816; b=QkFb1liUZhadu+5UCqgl++7g63faczoSZRFk8MvIGPZ+UC1wakQxVYZM6qOHm9YhBH ILRzVR9adl5lvQMrgV3aG9TRiqvkProe/cmlRjsZFH4A9noE1orh9nuK9zRgIRwMV9rk E7RWPjIMbHclSOUqgu2KF+6gC9RUg2mB1kxi2wR30nMVatxlgKk4Nh5W0Dae4l6+Gosu M6mlISiQgcogvC6PkavOyZ/K55Qzc0jtSy3Dlw+Xo9nInuFP39dRgwztH+o1Hva2XSlp IVy09eL2n7VThOuKVN/NIwsTUHUjBv0WOVk2NPm34P+r7OtjAVR/VsVTf4+iMoW1V5Tj 9FvA== 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=wKXxgAM4mPJPnLv7ZaJBTpthMneOHQHSrlQTeAoHA1U=; fh=r2ks6oCyUhFJ8De+x85SflMEYTLSKj0sjIF3YoYf3fg=; b=bN54DZld/2OPw85dBokOMj6UBEo9qeSQKU08hYTLTV/mZPpA47jRBBw47Pd+6q9Xjc MvHejqFXNvnx0WP1wLWp/jluJuvobh9xU6Mw2cXv0NUdZLY9thGSMDNTYaa7vNog8oH1 g1Aug3hpR+Lc2C/r6R0paHNxFfxdrq1L+2GP7ZrUvCelZ3UH2ZYWV6S9OjD67KExMtdt JHM4mX4NOH9tPOTkAHolL7JblZUoU8WseC6iFI9ZULWEDpGAMwGeIikMimbPwLy15pG/ axf5WZiw+E1Ft+F5p+NlNiKTMQ+Bbw2MImdIICIqYHZDISv4UwlXGKAs/fh6wWSHmbz+ 129w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cKvp1USC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116014-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w2-20020a05640234c200b0056bd8f451d2si2199458edc.125.2024.03.25.01.14.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 01:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cKvp1USC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116014-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 90BC71F2FD79 for ; Mon, 25 Mar 2024 08:14:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF9D917C63F; Mon, 25 Mar 2024 03:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cKvp1USC" 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 92F39219542; Sun, 24 Mar 2024 23:35:49 +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=1711323350; cv=none; b=st3gsPTb74AiTLGGeEl/NH07NL7TdPSdzZPxtKl/Svus16snX1SKblne9sLBa9p9BfKbkblEJpFj9QJ7dbuaDP51PdnpWmv+TwEu88IxAFP0vGI117qYQW2R2jRFuInxC4e0QbonFLGdqgLO2HkFPuSPDDWr4WTvavxNp0myIu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323350; c=relaxed/simple; bh=Pym40Mvyrep7NQDgHM/rPOEdnrvgk4WaB7EzFAhrMDA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AIHN/GmjGgOusZ0WGpHyBD1fQjSWJAjO13V9m0PyXnQ87ITFNiue0QzPMkyOpIKb0jW6qSa6MQYqB9sBzjiFudQix9SWtarM7u3o/Q6ESpcznKuRKB5E0KhdptyYwik++k5kqnJaNe3blzXPoHGJWTSMcWJqKYIsM9Rje9jb9XQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cKvp1USC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B65C7C433C7; Sun, 24 Mar 2024 23:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323349; bh=Pym40Mvyrep7NQDgHM/rPOEdnrvgk4WaB7EzFAhrMDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cKvp1USCugjwSb5gECxI7l3u3cQIdzqFo/JZ9XDB6AQZHvc55lT0+aYhXUi45ymFW xtNOsa5iqdO93gQ3koE48Ck11jQJf5iRdtqGCSpCPhuxzKZuauY9Sc7lmtoC0Bg6vJ xd9WWTxmnlQXfhf+mm+9QtyYlp3T0V+sPXP5DA74dGJFAHzYQUvlsv4hncJjkRMabF aL9ce+izv/nAqCQmc1WSY2xLDdeP6nY4xuqmZU/CCvm5aj+fdcqJA2v6YUuW56oIfT JnHJqg5qpC7TJ6c12lKr62ohnLAgACW3NTLWc19r0nBrRZjFpnpx8w7jupZ7mHcARk TT8A/y0Pxi5Vw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Keisuke Nishimura , Julia Lawall , Ingo Molnar , Sasha Levin Subject: [PATCH 5.15 049/317] sched/fair: Take the scheduling domain into account in select_idle_core() Date: Sun, 24 Mar 2024 19:30:29 -0400 Message-ID: <20240324233458.1352854-50-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324233458.1352854-1-sashal@kernel.org> References: <20240324233458.1352854-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 b55d51b4105cd..4a1393405a6fe 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6394,7 +6394,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; } @@ -6402,7 +6402,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