| /linux/kernel/sched/ext/ |
| H A D | sub.c | 103 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 D | ext.c | 382 if (rq->scx.flags & SCX_RQ_IN_DISPATCH) in rq_is_open() 398 likely(!(curr->scx.flags & SCX_TASK_PROTECTED)); in rq_is_open() 426 rq->scx.lock_drop_seq++; in scx_rq_lock_drop() 513 list_node = &cur->scx.dsq_list.node; in nldsq_next_task() 531 return container_of(dsq_lnode, struct task_struct, scx.dsq_list); in nldsq_next_task() 563 p = container_of(cursor, struct task_struct, scx.dsq_list); in nldsq_cursor_next_task() 568 } while (p && unlikely(u32_before(cursor->priv, p->scx.dsq_seq))); in nldsq_cursor_next_task() 572 list_move_tail(&cursor->node, &p->scx.dsq_list.node); in nldsq_cursor_next_task() 574 list_move(&cursor->node, &p->scx.dsq_list.node); in nldsq_cursor_next_task() 606 if (unlikely(p->scx.dsq != dsq || in nldsq_cursor_lost_task() [all …]
|
| H A D | inlines.h | 91 rq->scx.sub_dispatch_prev = prev; in scx_dispatch_sched() 99 rq->scx.sub_dispatch_prev = NULL; in scx_dispatch_sched() 104 if ((prev->scx.flags & SCX_TASK_QUEUED) && prev->scx.slice) in scx_dispatch_sched() 106 if (rq->scx.local_dsq.nr) in scx_dispatch_sched()
|
| H A D | internal.h | 2175 schedule_dsq_reenq(root, &rq->scx.local_dsq, reenq_flags, rq); in scx_schedule_reenq_local() 2257 WARN_ON_ONCE(current->scx.kf_tasks[0]); \ 2258 current->scx.kf_tasks[0] = task; \ 2260 current->scx.kf_tasks[0] = NULL; \ 2285 WARN_ON_ONCE(current->scx.kf_tasks[0]); \ 2286 current->scx.kf_tasks[0] = task; \ 2288 current->scx.kf_tasks[0] = NULL; \ 2295 WARN_ON_ONCE(current->scx.kf_tasks[0]); \ 2296 current->scx.kf_tasks[0] = task0; \ 2297 current->scx.kf_tasks[1] = task1; \ [all …]
|
| H A D | sub.h | 94 …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 D | idle.c | 555 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() 983 if (this_rq()->scx.in_select_cpu) { in select_cpu_from_kfunc()
|
| /linux/tools/testing/selftests/sched_ext/ |
| H A D | select_cpu_vtime.bpf.c | 13 #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 D | maybe_null_fail_dsp.bpf.c | 17 vtime_test = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
|
| H A D | maybe_null.bpf.c | 18 vtime_test = p->scx.dsq_vtime; in BPF_STRUCT_OPS()
|
| H A D | ddsp_bogus_dsq_fail.bpf.c | 25 p->scx.dsq_vtime, 0); in BPF_STRUCT_OPS()
|
| H A D | ddsp_vtimelocal_fail.bpf.c | 22 p->scx.dsq_vtime, 0); in BPF_STRUCT_OPS()
|
| /linux/init/ |
| H A D | init_task.c | 144 .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/ |
| H A D | scx_qmap.bpf.c | 347 if (p->scx.weight < 2 && !(p->flags & PF_KTHREAD)) in BPF_STRUCT_OPS() 406 int idx = weight_to_idx(p->scx.weight); in BPF_STRUCT_OPS() 410 u64 reason = p->scx.flags & SCX_TASK_REENQ_REASON_MASK; in BPF_STRUCT_OPS() 517 p->scx.weight < 2 && !(p->flags & PF_KTHREAD) && !(enq_flags & SCX_ENQ_REENQ)) { in BPF_STRUCT_OPS() 552 if (highpri_boosting && p->scx.weight >= HIGHPRI_WEIGHT) { in BPF_STRUCT_OPS() 577 int idx = weight_to_idx(p->scx.weight); in update_core_sched_head_seq() 836 qa.core_sched_tail_seqs[weight_to_idx(prev->scx.weight)]++; in BPF_STRUCT_OPS() 850 cpuc->avg_weight = cpuc->avg_weight * 3 / 4 + p->scx.weight / 4; in BPF_STRUCT_OPS() 863 int idx = weight_to_idx(p->scx.weight); in task_qdist() 901 return time_before(a->scx.runnable_at, b->scx.runnable_at); in BPF_STRUCT_OPS() [all …]
|
| H A D | scx_flatcg.bpf.c | 393 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 = time_delta(p->scx.dsq_vtime, from_cgc->tvtime_now); in BPF_STRUCT_OPS()
|
| H A D | Makefile | 177 $(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 D | README.md | 157 https://github.com/sched-ext/scx.
|
| /linux/tools/sched_ext/include/scx/ |
| H A D | compat.bpf.h | 370 p->scx.slice = slice; in scx_bpf_task_set_slice() 378 p->scx.dsq_vtime = vtime; in scx_bpf_task_set_dsq_vtime()
|
| H A D | common.bpf.h | 900 return (value * p->scx.weight) / 100; in scale_by_task_weight() 908 return value * 100 / p->scx.weight; in scale_by_task_weight_inverse()
|
| /linux/kernel/sched/ |
| H A D | sched.h | 507 struct scx_task_group scx; member 1215 struct scx_rq scx; member 1900 WRITE_ONCE(rq->scx.clock, clock); in scx_rq_clock_update() 1901 smp_store_release(&rq->scx.flags, rq->scx.flags | SCX_RQ_CLK_VALID); in scx_rq_clock_update() 1908 WRITE_ONCE(rq->scx.flags, rq->scx.flags & ~SCX_RQ_CLK_VALID); in scx_rq_clock_invalidate()
|
| H A D | core.c | 4612 init_scx_entity(&p->scx); in __sched_fork() 9820 return sched_weight_from_cgroup(tg->scx.weight); in tg_weight() 10107 *period_us_p = tg->scx.bw_period_us; in tg_bandwidth() 10109 *quota_us_p = tg->scx.bw_quota_us; in tg_bandwidth() 10111 *burst_us_p = tg->scx.bw_burst_us; in tg_bandwidth()
|
| /linux/Documentation/scheduler/ |
| H A D | sched-ext.rst | 432 if (task is not in a DSQ || task->scx.slice == 0) { 454 while (task_is_runnable(task) && task->scx.slice > 0) { 457 if (task->scx.slice == 0) 458 ops.dispatch(); /* task->scx.slice can be refilled */
|
| /linux/kernel/ |
| H A D | Kconfig.preempt | 199 https://github.com/sched-ext/scx
|
| /linux/ |
| H A D | MAINTAINERS | 24495 W: https://github.com/sched-ext/scx
|