Commit 38ef0465 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sched_ext updates from Tejun Heo:

 - Move C example schedulers back from the external scx repo to
   tools/sched_ext as the authoritative source. scx_userland and
   scx_pair are returning while scx_sdt (BPF arena-based task data
   management) is new. These schedulers will be dropped from the
   external repo.

 - Improve error reporting by adding scx_bpf_error() calls when DSQ
   creation fails across all in-tree schedulers

 - Avoid redundant irq_work_queue() calls in destroy_dsq() by only
   queueing when llist_add() indicates an empty list

 - Fix flaky init_enable_count selftest by properly synchronizing
   pre-forked children using a pipe instead of sleep()

* tag 'sched_ext-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
  selftests/sched_ext: Fix init_enable_count flakiness
  tools/sched_ext: Fix data header access during free in scx_sdt
  tools/sched_ext: Add error logging for dsq creation failures in remaining schedulers
  tools/sched_ext: add arena based scheduler
  tools/sched_ext: add scx_pair scheduler
  tools/sched_ext: add scx_userland scheduler
  sched_ext: Add error logging for dsq creation failures
  sched_ext: Avoid multiple irq_work_queue() calls in destroy_dsq()
parents ff661eee 4544e9c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3520,7 +3520,7 @@ static void destroy_dsq(struct scx_sched *sch, u64 dsq_id)
	 * operations inside scheduler locks.
	 */
	dsq->id = SCX_DSQ_INVALID;
	llist_add(&dsq->free_node, &dsqs_to_free);
	if (llist_add(&dsq->free_node, &dsqs_to_free))
		irq_work_queue(&free_dsq_irq_work);

out_unlock_dsq:
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BP

SCX_COMMON_DEPS := include/scx/common.h include/scx/user_exit_info.h | $(BINDIR)

c-sched-targets = scx_simple scx_cpu0 scx_qmap scx_central scx_flatcg
c-sched-targets = scx_simple scx_cpu0 scx_qmap scx_central scx_flatcg scx_userland scx_pair scx_sdt

$(addprefix $(BINDIR)/,$(c-sched-targets)): \
	$(BINDIR)/%: \
+3 −1
Original line number Diff line number Diff line
@@ -301,8 +301,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(central_init)
	int ret;

	ret = scx_bpf_create_dsq(FALLBACK_DSQ_ID, -1);
	if (ret)
	if (ret) {
		scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
		return ret;
	}

	timer = bpf_map_lookup_elem(&central_timer, &key);
	if (!timer)
+9 −1
Original line number Diff line number Diff line
@@ -71,7 +71,15 @@ void BPF_STRUCT_OPS(cpu0_dispatch, s32 cpu, struct task_struct *prev)

s32 BPF_STRUCT_OPS_SLEEPABLE(cpu0_init)
{
	return scx_bpf_create_dsq(DSQ_CPU0, -1);
	int ret;

	ret = scx_bpf_create_dsq(DSQ_CPU0, -1);
	if (ret) {
		scx_bpf_error("failed to create DSQ %d (%d)", DSQ_CPU0, ret);
		return ret;
	}

	return 0;
}

void BPF_STRUCT_OPS(cpu0_exit, struct scx_exit_info *ei)
+12 −2
Original line number Diff line number Diff line
@@ -842,8 +842,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(fcg_cgroup_init, struct cgroup *cgrp,
	 * unlikely case that it breaks.
	 */
	ret = scx_bpf_create_dsq(cgid, -1);
	if (ret)
	if (ret) {
		scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
		return ret;
	}

	cgc = bpf_cgrp_storage_get(&cgrp_ctx, cgrp, 0,
				   BPF_LOCAL_STORAGE_GET_F_CREATE);
@@ -927,7 +929,15 @@ void BPF_STRUCT_OPS(fcg_cgroup_move, struct task_struct *p,

s32 BPF_STRUCT_OPS_SLEEPABLE(fcg_init)
{
	return scx_bpf_create_dsq(FALLBACK_DSQ, -1);
	int ret;

	ret = scx_bpf_create_dsq(FALLBACK_DSQ, -1);
	if (ret) {
		scx_bpf_error("failed to create DSQ %d (%d)", FALLBACK_DSQ, ret);
		return ret;
	}

	return 0;
}

void BPF_STRUCT_OPS(fcg_exit, struct scx_exit_info *ei)
Loading