mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] sched_ext: idle: Remove unnecessary ifdef in scx_bpf_cpu_node()
Date: Wed,  4 Jun 2025 16:33:11 +0200	[thread overview]
Message-ID: <20250604143547.708202-2-arighi@nvidia.com> (raw)
In-Reply-To: <20250604143547.708202-1-arighi@nvidia.com>

There's no need to make scx_bpf_cpu_node() dependent on CONFIG_NUMA,
since cpu_to_node() can be used also in systems with CONFIG_NUMA
disabled.

This also allows to always validate the @cpu argument regardless of the
CONFIG_NUMA settings.

Fixes: 01059219b0cfd ("sched_ext: idle: Introduce node-aware idle cpu kfunc helpers")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
---
 kernel/sched/ext_idle.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
index 6d29d3cbc6707..1598681b681e7 100644
--- a/kernel/sched/ext_idle.c
+++ b/kernel/sched/ext_idle.c
@@ -929,14 +929,10 @@ s32 select_cpu_from_kfunc(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
  */
 __bpf_kfunc int scx_bpf_cpu_node(s32 cpu)
 {
-#ifdef CONFIG_NUMA
 	if (!kf_cpu_valid(cpu, NULL))
 		return NUMA_NO_NODE;
 
 	return cpu_to_node(cpu);
-#else
-	return 0;
-#endif
 }
 
 /**
-- 
2.49.0


  reply	other threads:[~2025-06-04 14:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 14:33 [PATCH 0/4] sched_ext: Improve code modularization Andrea Righi
2025-06-04 14:33 ` Andrea Righi [this message]
2025-06-04 14:33 ` [PATCH 2/4] sched_ext: idle: Make local functions static in ext_idle.c Andrea Righi
2025-06-04 14:33 ` [PATCH 3/4] sched_ext: Make scx_rq_bypassing() inline Andrea Righi
2025-06-04 14:33 ` [PATCH 4/4] sched_ext: Make scx_locked_rq() shared Andrea Righi
2025-06-04 18:48   ` Tejun Heo
2025-06-04 18:49     ` Tejun Heo
2025-06-05  5:28   ` Changwoo Min
2025-06-05  6:17     ` Andrea Righi
2025-06-05  9:30   ` [PATCH v2 4/4] sched_ext: Make scx_locked_rq() inline Andrea Righi
2025-06-09 16:26 ` [PATCH 0/4] sched_ext: Improve code modularization Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250604143547.708202-2-arighi@nvidia.com \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®