sched_ext: Move refill_task_slice_dfl() below apply_slice_vtime()

Move refill_task_slice_dfl() below apply_slice_vtime(), with the other slice
writers, to prepare for the kernel-slice handling the following patches add
to them. No functional change.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
This commit is contained in:
Tejun Heo 2026-10-26 14:17:36 -10:00
parent a676ada0d6
commit 867d0ac6d7

View File

@ -1569,6 +1569,16 @@ static void apply_slice_vtime(struct task_struct *p, u64 slice, u64 vtime, u64 e
p->scx.dsq_vtime = vtime;
}
static void refill_task_slice_dfl(struct scx_sched *sch, struct task_struct *p)
{
/*
* A default refill is not an explicit request, so it must not drop a
* pending out-of-band one, which is applied when @p next runs.
*/
set_task_slice_keep_oob(p, READ_ONCE(sch->slice_dfl));
__scx_add_event(sch, SCX_EV_REFILL_SLICE_DFL, 1);
}
static void update_curr_scx(struct rq *rq)
{
struct task_struct *donor;
@ -1662,16 +1672,6 @@ static void dsq_dec_nr(struct scx_dispatch_q *dsq, struct task_struct *p)
}
}
static void refill_task_slice_dfl(struct scx_sched *sch, struct task_struct *p)
{
/*
* A default refill is not an explicit request, so it must not drop a
* pending out-of-band one, which is applied when @p next runs.
*/
set_task_slice_keep_oob(p, READ_ONCE(sch->slice_dfl));
__scx_add_event(sch, SCX_EV_REFILL_SLICE_DFL, 1);
}
/*
* Return true if @p is moving due to an internal SCX migration, false
* otherwise.