tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf.c
Extension
.c
Size
1090 bytes
Lines
39
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <scx/common.bpf.h>

char _license[] SEC("license") = "GPL";

UEI_DEFINE(uei);

s32 BPF_STRUCT_OPS(select_cpu_dispatch_dbl_dsp_select_cpu, struct task_struct *p,
		   s32 prev_cpu, u64 wake_flags)
{
	/* Dispatching twice in a row is disallowed. */
	scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, 0);
	scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, 0);

	return prev_cpu;
}

void BPF_STRUCT_OPS(select_cpu_dispatch_dbl_dsp_exit, struct scx_exit_info *ei)
{
	UEI_RECORD(uei, ei);
}

SEC(".struct_ops.link")
struct sched_ext_ops select_cpu_dispatch_dbl_dsp_ops = {
	.select_cpu		= (void *) select_cpu_dispatch_dbl_dsp_select_cpu,
	.exit			= (void *) select_cpu_dispatch_dbl_dsp_exit,
	.name			= "select_cpu_dispatch_dbl_dsp",
	.timeout_ms		= 1000U,
};

Annotation

Implementation Notes