[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250929092221.10947-25-yurand2000@gmail.com>
Date: Mon, 29 Sep 2025 11:22:21 +0200
From: Yuri Andriaccio <yurand2000@...il.com>
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Luca Abeni <luca.abeni@...tannapisa.it>,
Yuri Andriaccio <yuri.andriaccio@...tannapisa.it>
Subject: [RFC PATCH v3 24/24] sched/core: Execute enqueued balance callbacks when migrating task betweeen cgroups
Execute balancing callbacks when migrating task between cgroups, since the HCBS
scheduler, similarly to the previous patch, may request balancing of throttled
dl_servers to fully utilize the server's bandwidth.
Signed-off-by: Yuri Andriaccio <yurand2000@...il.com>
---
kernel/sched/core.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7639e9abba1..8d99a0c20c6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -9251,10 +9251,11 @@ void sched_move_task(struct task_struct *tsk, bool for_autogroup)
{
int queued, running, queue_flags =
DEQUEUE_SAVE | DEQUEUE_MOVE | DEQUEUE_NOCLOCK;
+ struct balance_callback *head;
struct rq *rq;
+ struct rq_flags rf;
- CLASS(task_rq_lock, rq_guard)(tsk);
- rq = rq_guard.rq;
+ rq = task_rq_lock(tsk, &rf);
update_rq_clock(rq);
@@ -9281,6 +9282,12 @@ void sched_move_task(struct task_struct *tsk, bool for_autogroup)
*/
resched_curr(rq);
}
+
+ preempt_disable();
+ head = splice_balance_callbacks(rq);
+ task_rq_unlock(rq, tsk, &rf);
+ balance_callbacks(rq, head);
+ preempt_enable();
}
static struct cgroup_subsys_state *
--
2.51.0
Powered by blists - more mailing lists