From nobody Sun Feb 8 05:06:21 2026 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (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 C5DB6194A6B for ; Wed, 8 Jan 2025 02:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736304940; cv=none; b=nbbk+QOHysAJaaKKCfzs1KfaL6JVFAvca8Hc6jeMxJlt1apHSVPWsFpsho+XIdBi3arG7IEGByH6atrAbuXKiIRX7rx9PpJfQrKvcqZUGHaC/j2B8VC5Y7veJsEwHM+PR3G4WxmHOeVwBLO2809uAmVoxYUeJiPHytRSsA7YPx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736304940; c=relaxed/simple; bh=JXZK8apeymfhpodtihIH47fNzL/TT8vKoPnxgqZeBiQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gMjyAZO1wQcfZxeSu5KPQULZBXkGnvrZQY3bJk4Tb2jBQwn640D06qfgjPF4/qDTrYz0TWexgE6L7kcNx0tRIEUORW05U8Dm1bYgidSMxsowbFoGFPGkEDIJVgGYy0WgRvJ8hODCXTJVyyBA9/QIULu5fpXdJQsrRqJdotT6Nwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=SZfsqJUx; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="SZfsqJUx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2H8QHv6NzernF4ScMeC3Piv07Uj+Klgx1twKeCSQJ6E=; b=SZfsqJUxQS344Kpbn1ZXobf94w iCuBaC7DzY/A+9klLRVrGTrZHn3ZNitBGQWomStPsPNlBHIz1uep5My0Gv+qHHE3eA8cLpygw9bW+ RzUEu6BjrdjGjdzXVONALMRhqK7RU78eYmrPtyuCazTa5eCmqcB8RW6D+rVI+3EZi7jNWswCVN4Fa BFypiy+3AjMahUe+qRcy7Ip2EpQ2yyIMsurK/+oUxkVZMZZRvBil1QMA/17j3RRB2qhW4wP9d+LJl cHgxRICVgAEGqceC5MPMKetZ6d1V5qsQf7N6tRo1kjsdgjtgFcuvhRUtG+RfEW//zgxWiTf/Yoz80 0seYJaHg==; Received: from [58.29.143.236] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1tVMEC-00Cyev-3d; Wed, 08 Jan 2025 03:55:28 +0100 From: Changwoo Min To: tj@kernel.org, void@manifault.com, arighi@nvidia.com Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, Changwoo Min Subject: [PATCH] sched_ext: Replace rq_lock() to raw_spin_rq_lock() in scx_ops_bypass() Date: Wed, 8 Jan 2025 11:55:21 +0900 Message-ID: <20250108025521.85877-1-changwoo@igalia.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" scx_ops_bypass() iterates all CPUs to re-enqueue all the scx tasks. For each CPU, it acquires a lock using rq_lock() regardless of whether a CPU is offline or the CPU is currently running a task in a higher scheduler class (e.g., deadline). The rq_lock() is supposed to be used for online CPUs, and the use of rq_lock() may trigger an unnecessary warning in rq_pin_lock(). Therefore, replace rq_lock() to raw_spin_rq_lock() in scx_ops_bypass(). Signed-off-by: Changwoo Min --- kernel/sched/ext.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 8fe64c27004e..741398f3e730 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4803,10 +4803,9 @@ static void scx_ops_bypass(bool bypass) */ for_each_possible_cpu(cpu) { struct rq *rq =3D cpu_rq(cpu); - struct rq_flags rf; struct task_struct *p, *n; =20 - rq_lock(rq, &rf); + raw_spin_rq_lock(rq); =20 if (bypass) { WARN_ON_ONCE(rq->scx.flags & SCX_RQ_BYPASSING); @@ -4822,7 +4821,7 @@ static void scx_ops_bypass(bool bypass) * sees scx_rq_bypassing() before moving tasks to SCX. */ if (!scx_enabled()) { - rq_unlock(rq, &rf); + raw_spin_rq_unlock(rq); continue; } =20 @@ -4842,7 +4841,7 @@ static void scx_ops_bypass(bool bypass) sched_enq_and_set_task(&ctx); } =20 - rq_unlock(rq, &rf); + raw_spin_rq_unlock(rq); =20 /* resched to restore ticks and idle state */ resched_cpu(cpu); --=20 2.47.1