Home
last modified time | relevance | path

Searched refs:scx (Results 1 – 25 of 25) sorted by relevance

/linux/kernel/sched/ext/
H A Dsub.c103 rcu_assign_pointer(p->scx.sched, sch); in scx_set_task_sched()
242 s64 served = rq->scx.rescue.curr->se.sum_exec_runtime - rq->scx.rescue.exec_snap; in scx_rescue_slice_remaining()
244 return max(rq->scx.rescue.slice - served, 0); in scx_rescue_slice_remaining()
285 rq->scx.rescue.budget -= delta_exec; in scx_rescue_charge()
292 scx_task_slice_ended(rq, rq->scx.rescue.curr); in scx_rescue_charge()
308 rq->scx.rescue.curr = NULL; in scx_rescue_end()
309 if (list_empty(&rq->scx.rescue.dsq.list)) in scx_rescue_end()
310 rq->scx.rescue.budget = min(rq->scx.rescue.budget, scx_rescue_quantum_ns); in scx_rescue_end()
334 if (!remaining || !(p->scx.flags & SCX_TASK_QUEUED) || in scx_rescue_keep()
354 bool in_session = rq->scx.rescue.curr || !list_empty(&rq->scx.rescue.dsq.list); in scx_rescue_accrue()
[all …]
H A Dext.c387 if (rq->scx.flags & SCX_RQ_IN_DISPATCH) in rq_is_open()
403 likely(!(curr->scx.flags & SCX_TASK_PROTECTED)); in rq_is_open()
431 rq->scx.lock_drop_seq++; in scx_rq_lock_drop()
526 list_node = &cur->scx.dsq_list.node; in nldsq_next_task()
544 return container_of(dsq_lnode, struct task_struct, scx.dsq_list); in nldsq_next_task()
576 p = container_of(cursor, struct task_struct, scx.dsq_list); in nldsq_cursor_next_task()
581 } while (p && unlikely(u32_before(cursor->priv, p->scx.dsq_seq))); in nldsq_cursor_next_task()
585 list_move_tail(&cursor->node, &p->scx.dsq_list.node); in nldsq_cursor_next_task()
587 list_move(&cursor->node, &p->scx.dsq_list.node); in nldsq_cursor_next_task()
619 if (unlikely(p->scx.dsq != dsq || in nldsq_cursor_lost_task()
[all …]
H A Dinlines.h79 if (unlikely(!SCX_HAS_OP(sch, dispatch)) || !(rq->scx.flags & SCX_RQ_ONLINE)) in scx_dispatch_sched()
97 rq->scx.sub_dispatch_prev = prev; in scx_dispatch_sched()
105 rq->scx.sub_dispatch_prev = NULL; in scx_dispatch_sched()
110 if ((prev->scx.flags & SCX_TASK_QUEUED) && prev->scx.slice) in scx_dispatch_sched()
112 if (rq->scx.local_dsq.nr) in scx_dispatch_sched()
H A Dinternal.h2252 schedule_dsq_reenq(root, &rq->scx.local_dsq, reenq_flags, rq); in scx_schedule_reenq_local()
2334 WARN_ON_ONCE(current->scx.kf_tasks[0]); \
2335 current->scx.kf_tasks[0] = task; \
2337 current->scx.kf_tasks[0] = NULL; \
2362 WARN_ON_ONCE(current->scx.kf_tasks[0]); \
2363 current->scx.kf_tasks[0] = task; \
2365 current->scx.kf_tasks[0] = NULL; \
2372 WARN_ON_ONCE(current->scx.kf_tasks[0]); \
2373 current->scx.kf_tasks[0] = task0; \
2374 current->scx.kf_tasks[1] = task1; \
[all …]
H A Dsub.h94 …cx_sched *sch, struct rq *rq, struct task_struct *p, u64 *enq_flags) { return &rq->scx.local_dsq; } in scx_resolve_local_dsq()
167 if (p->scx.flags & SCX_TASK_IMMED) in scx_caps_for_task()
220 return rq->scx.rescue.curr; in scx_rescuee()
H A Dext.h12 void init_scx_entity(struct sched_ext_entity *scx);
31 return cpu_rq(cpu)->scx.cpuperf_target; in scx_cpuperf_target()
H A Didle.c555 cpu_rq(cpu)->scx.local_dsq.nr == 0 && in scx_select_cpu_dfl()
829 (idle && (rq->scx.flags & in __scx_update_idle()
831 bool root_renotify = rq->scx.flags & SCX_RQ_ROOT_IDLE_RENOTIFY; in __scx_update_idle()
833 rq->scx.flags &= ~(SCX_RQ_SUB_IDLE_RENOTIFY | SCX_RQ_ROOT_IDLE_RENOTIFY); in __scx_update_idle()
1014 if (this_rq()->scx.in_select_cpu) { in select_cpu_from_kfunc()
/linux/tools/testing/selftests/sched_ext/
H A Dselect_cpu_vtime.bpf.c13 #include <scx/common.bpf.h>
30 u64 vtime = p->scx.dsq_vtime; in task_vtime()
62 if (vtime_before(vtime_now, p->scx.dsq_vtime)) in BPF_STRUCT_OPS()
63 vtime_now = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
69 u64 delta = scale_by_task_weight_inverse(p, SCX_SLICE_DFL - p->scx.slice); in BPF_STRUCT_OPS()
71 scx_bpf_task_set_dsq_vtime(p, p->scx.dsq_vtime + delta);
H A Dmaybe_null_fail_dsp.bpf.c17 vtime_test = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
H A Dmaybe_null.bpf.c18 vtime_test = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
H A Dddsp_bogus_dsq_fail.bpf.c25 p->scx.dsq_vtime, 0); in BPF_STRUCT_OPS()
H A Dddsp_vtimelocal_fail.bpf.c22 p->scx.dsq_vtime, 0); in BPF_STRUCT_OPS()
/linux/tools/sched_ext/
H A Dscx_qmap.bpf.c350 if (p->scx.weight < 2 && !(p->flags & PF_KTHREAD)) in BPF_STRUCT_OPS()
409 int idx = weight_to_idx(p->scx.weight); in BPF_STRUCT_OPS()
413 u64 reason = p->scx.flags & SCX_TASK_REENQ_REASON_MASK; in BPF_STRUCT_OPS()
522 p->scx.weight < 2 && !(p->flags & PF_KTHREAD) && !(enq_flags & SCX_ENQ_REENQ)) { in BPF_STRUCT_OPS()
557 if (highpri_boosting && p->scx.weight >= HIGHPRI_WEIGHT) { in BPF_STRUCT_OPS()
582 int idx = weight_to_idx(p->scx.weight); in update_core_sched_head_seq()
850 qa.core_sched_tail_seqs[weight_to_idx(prev->scx.weight)]++; in BPF_STRUCT_OPS()
866 cpuc->avg_weight = cpuc->avg_weight * 3 / 4 + p->scx.weight / 4; in BPF_STRUCT_OPS()
879 int idx = weight_to_idx(p->scx.weight); in task_qdist()
917 return time_before(a->scx.runnable_at, b->scx.runnable_at); in BPF_STRUCT_OPS()
[all …]
H A Dscx_flatcg.bpf.c393 u64 tvtime = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
533 if (time_before(cgc->tvtime_now, p->scx.dsq_vtime)) in BPF_STRUCT_OPS()
534 cgc->tvtime_now = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
555 u64 delta = scale_by_task_weight_inverse(p, SCX_SLICE_DFL - p->scx.slice); in BPF_STRUCT_OPS()
557 scx_bpf_task_set_dsq_vtime(p, p->scx.dsq_vtime + delta); in BPF_STRUCT_OPS()
940 delta = (s64)(p->scx.dsq_vtime - from_cgc->tvtime_now); in BPF_STRUCT_OPS()
H A DMakefile177 $(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h include/scx/*.h \
192 SCX_COMMON_DEPS := include/scx/common.h include/scx/user_exit_info.h | $(BINDIR)
H A DREADME.md157 https://github.com/sched-ext/scx.
/linux/init/
H A Dinit_task.c144 .scx = {
145 .dsq_list.node = LIST_HEAD_INIT(init_task.scx.dsq_list.node),
149 .runnable_node = LIST_HEAD_INIT(init_task.scx.runnable_node),
/linux/tools/sched_ext/include/scx/
H A Dcompat.bpf.h395 p->scx.slice = slice; in scx_bpf_task_set_slice()
403 p->scx.dsq_vtime = vtime; in scx_bpf_task_set_dsq_vtime()
H A Dcommon.bpf.h974 return (value * p->scx.weight) / 100; in scale_by_task_weight()
982 return value * 100 / p->scx.weight; in scale_by_task_weight_inverse()
/linux/kernel/sched/
H A Dsched.h507 struct scx_task_group scx; member
1214 struct scx_rq scx; member
1901 WRITE_ONCE(rq->scx.clock, clock); in scx_rq_clock_update()
1902 smp_store_release(&rq->scx.flags, rq->scx.flags | SCX_RQ_CLK_VALID); in scx_rq_clock_update()
1909 WRITE_ONCE(rq->scx.flags, rq->scx.flags & ~SCX_RQ_CLK_VALID); in scx_rq_clock_invalidate()
H A Dcore.c4675 init_scx_entity(&p->scx); in __sched_fork()
9781 return sched_weight_from_cgroup(tg->scx.weight); in tg_weight()
10068 *period_us_p = tg->scx.bw_period_us; in tg_bandwidth()
10070 *quota_us_p = tg->scx.bw_quota_us; in tg_bandwidth()
10072 *burst_us_p = tg->scx.bw_burst_us; in tg_bandwidth()
/linux/Documentation/scheduler/
H A Dsched-ext.rst447 if (task is not in a DSQ || task->scx.slice == 0) {
469 while (task_is_runnable(task) && task->scx.slice > 0) {
472 if (task->scx.slice == 0)
473 ops.dispatch(); /* task->scx.slice can be refilled */
/linux/kernel/
H A DKconfig.preempt196 https://github.com/sched-ext/scx
/linux/include/linux/
H A Dsched.h895 struct sched_ext_entity scx; member
/linux/
H A DMAINTAINERS24613 W: https://github.com/sched-ext/scx