lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250630184709.3831581-1-magazo2005@gmail.com>
Date: Mon, 30 Jun 2025 20:47:09 +0200
From: Marcos Garcia <magazo2005@...il.com>
To: tj@...nel.org,
	void@...ifault.com,
	mingo@...hat.com,
	peterz@...radead.org
Cc: arighi@...dia.com,
	changwoo@...lia.com,
	juri.lelli@...hat.com,
	vincent.guittot@...aro.org,
	sched-ext@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Marcos Garcia <magazo2005@...il.com>
Subject: [PATCH sched/ext v2] sched/ext: Implement cgroup idle state notification

Add scx_group_set_idle() to notify BPF schedulers when task groups become
idle or active. This enables schedulers to:
- Optimize resource allocation for inactive cgroups
- Implement power-saving policies
- Improve load balancing decisions

The implementation safely invokes the BPF scheduler's cgroup_set_idle
callback under RCU protection. The callback is optional - schedulers
not needing this notification can omit it.

Signed-off-by: Marcos Garcia <magazo2005@...il.com>
---
 kernel/sched/ext.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index b498d867ba21..7cecc0ca700d 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -4258,7 +4258,13 @@ void scx_group_set_weight(struct task_group *tg, unsigned long weight)
 
 void scx_group_set_idle(struct task_group *tg, bool idle)
 {
-	/* TODO: Implement ops->cgroup_set_idle() */
+	struct sched_ext_ops *ops;
+
+	rcu_read_lock();
+	ops = rcu_dereference(ext_ops);
+	if (ops && ops->cgroup_set_idle)
+		ops->cgroup_set_idle(tg, idle);
+	rcu_read_unlock();
 }
 
 static void scx_cgroup_lock(void)
-- 
2.50.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ