public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched_ext: switch class when preempted by higher priority scheduler
@ 2025-01-07  1:46 Honglei Wang
  2025-01-07 20:34 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Honglei Wang @ 2025-01-07  1:46 UTC (permalink / raw)
  To: tj, void, arighi, changwoo
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, vschneid, linux-kernel

It might be helpful to give BPF Scheduler a chance to invoke
cpu_release() function, if defined, when preempted by a higher
priority scheduler class task.

Signed-off-by: Honglei Wang <jameshongleiwang@126.com>
---
 kernel/sched/ext.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 19d2699cf638..ef0e3f2c1e6f 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3034,7 +3034,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
 		 */
 		if (p->scx.slice && !scx_rq_bypassing(rq)) {
 			dispatch_enqueue(&rq->scx.local_dsq, p, SCX_ENQ_HEAD);
-			return;
+			goto switch_class;
 		}
 
 		/*
@@ -3051,6 +3051,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
 		}
 	}
 
+switch_class:
 	if (next && next->sched_class != &ext_sched_class)
 		switch_class(rq, next);
 }
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched_ext: switch class when preempted by higher priority scheduler
  2025-01-07  1:46 [PATCH] sched_ext: switch class when preempted by higher priority scheduler Honglei Wang
@ 2025-01-07 20:34 ` Tejun Heo
  2025-01-08  1:50   ` Honglei Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2025-01-07 20:34 UTC (permalink / raw)
  To: Honglei Wang
  Cc: void, arighi, changwoo, mingo, peterz, juri.lelli,
	vincent.guittot, dietmar.eggemann, rostedt, bsegall, mgorman,
	vschneid, linux-kernel

Hello, Honglei.

On Tue, Jan 07, 2025 at 09:46:05AM +0800, Honglei Wang wrote:
> It might be helpful to give BPF Scheduler a chance to invoke
> cpu_release() function, if defined, when preempted by a higher
> priority scheduler class task.
> 
> Signed-off-by: Honglei Wang <jameshongleiwang@126.com>

Can you update the patch description indicating that this is a bug fix?
ops.cpu_release() must be invoked in this case but is being skipped.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched_ext: switch class when preempted by higher priority scheduler
  2025-01-07 20:34 ` Tejun Heo
@ 2025-01-08  1:50   ` Honglei Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Honglei Wang @ 2025-01-08  1:50 UTC (permalink / raw)
  To: Tejun Heo
  Cc: void, arighi, changwoo, mingo, peterz, juri.lelli,
	vincent.guittot, dietmar.eggemann, rostedt, bsegall, mgorman,
	vschneid, linux-kernel



On 2025/1/8 04:34, Tejun Heo wrote:
> Hello, Honglei.
> 
> On Tue, Jan 07, 2025 at 09:46:05AM +0800, Honglei Wang wrote:
>> It might be helpful to give BPF Scheduler a chance to invoke
>> cpu_release() function, if defined, when preempted by a higher
>> priority scheduler class task.
>>
>> Signed-off-by: Honglei Wang <jameshongleiwang@126.com>
> 
> Can you update the patch description indicating that this is a bug fix?
> ops.cpu_release() must be invoked in this case but is being skipped.
> 
> Thanks.
> 
OK, will send a update later.

Thanks,
Honglei


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-08  2:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07  1:46 [PATCH] sched_ext: switch class when preempted by higher priority scheduler Honglei Wang
2025-01-07 20:34 ` Tejun Heo
2025-01-08  1:50   ` Honglei Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox