~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/sched_ext/maximal.bpf.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * A scheduler with every callback defined.
  4  *
  5  * This scheduler defines every callback.
  6  *
  7  * Copyright (c) 2024 Meta Platforms, Inc. and affiliates.
  8  * Copyright (c) 2024 David Vernet <dvernet@meta.com>
  9  */
 10 
 11 #include <scx/common.bpf.h>
 12 
 13 char _license[] SEC("license") = "GPL";
 14 
 15 s32 BPF_STRUCT_OPS(maximal_select_cpu, struct task_struct *p, s32 prev_cpu,
 16                    u64 wake_flags)
 17 {
 18         return prev_cpu;
 19 }
 20 
 21 void BPF_STRUCT_OPS(maximal_enqueue, struct task_struct *p, u64 enq_flags)
 22 {
 23         scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
 24 }
 25 
 26 void BPF_STRUCT_OPS(maximal_dequeue, struct task_struct *p, u64 deq_flags)
 27 {}
 28 
 29 void BPF_STRUCT_OPS(maximal_dispatch, s32 cpu, struct task_struct *prev)
 30 {
 31         scx_bpf_consume(SCX_DSQ_GLOBAL);
 32 }
 33 
 34 void BPF_STRUCT_OPS(maximal_runnable, struct task_struct *p, u64 enq_flags)
 35 {}
 36 
 37 void BPF_STRUCT_OPS(maximal_running, struct task_struct *p)
 38 {}
 39 
 40 void BPF_STRUCT_OPS(maximal_stopping, struct task_struct *p, bool runnable)
 41 {}
 42 
 43 void BPF_STRUCT_OPS(maximal_quiescent, struct task_struct *p, u64 deq_flags)
 44 {}
 45 
 46 bool BPF_STRUCT_OPS(maximal_yield, struct task_struct *from,
 47                     struct task_struct *to)
 48 {
 49         return false;
 50 }
 51 
 52 bool BPF_STRUCT_OPS(maximal_core_sched_before, struct task_struct *a,
 53                     struct task_struct *b)
 54 {
 55         return false;
 56 }
 57 
 58 void BPF_STRUCT_OPS(maximal_set_weight, struct task_struct *p, u32 weight)
 59 {}
 60 
 61 void BPF_STRUCT_OPS(maximal_set_cpumask, struct task_struct *p,
 62                     const struct cpumask *cpumask)
 63 {}
 64 
 65 void BPF_STRUCT_OPS(maximal_update_idle, s32 cpu, bool idle)
 66 {}
 67 
 68 void BPF_STRUCT_OPS(maximal_cpu_acquire, s32 cpu,
 69                     struct scx_cpu_acquire_args *args)
 70 {}
 71 
 72 void BPF_STRUCT_OPS(maximal_cpu_release, s32 cpu,
 73                     struct scx_cpu_release_args *args)
 74 {}
 75 
 76 void BPF_STRUCT_OPS(maximal_cpu_online, s32 cpu)
 77 {}
 78 
 79 void BPF_STRUCT_OPS(maximal_cpu_offline, s32 cpu)
 80 {}
 81 
 82 s32 BPF_STRUCT_OPS(maximal_init_task, struct task_struct *p,
 83                    struct scx_init_task_args *args)
 84 {
 85         return 0;
 86 }
 87 
 88 void BPF_STRUCT_OPS(maximal_enable, struct task_struct *p)
 89 {}
 90 
 91 void BPF_STRUCT_OPS(maximal_exit_task, struct task_struct *p,
 92                     struct scx_exit_task_args *args)
 93 {}
 94 
 95 void BPF_STRUCT_OPS(maximal_disable, struct task_struct *p)
 96 {}
 97 
 98 s32 BPF_STRUCT_OPS(maximal_cgroup_init, struct cgroup *cgrp,
 99                    struct scx_cgroup_init_args *args)
100 {
101         return 0;
102 }
103 
104 void BPF_STRUCT_OPS(maximal_cgroup_exit, struct cgroup *cgrp)
105 {}
106 
107 s32 BPF_STRUCT_OPS(maximal_cgroup_prep_move, struct task_struct *p,
108                    struct cgroup *from, struct cgroup *to)
109 {
110         return 0;
111 }
112 
113 void BPF_STRUCT_OPS(maximal_cgroup_move, struct task_struct *p,
114                     struct cgroup *from, struct cgroup *to)
115 {}
116 
117 void BPF_STRUCT_OPS(maximal_cgroup_cancel_move, struct task_struct *p,
118                struct cgroup *from, struct cgroup *to)
119 {}
120 
121 void BPF_STRUCT_OPS(maximal_cgroup_set_weight, struct cgroup *cgrp, u32 weight)
122 {}
123 
124 s32 BPF_STRUCT_OPS_SLEEPABLE(maximal_init)
125 {
126         return 0;
127 }
128 
129 void BPF_STRUCT_OPS(maximal_exit, struct scx_exit_info *info)
130 {}
131 
132 SEC(".struct_ops.link")
133 struct sched_ext_ops maximal_ops = {
134         .select_cpu             = (void *) maximal_select_cpu,
135         .enqueue                = (void *) maximal_enqueue,
136         .dequeue                = (void *) maximal_dequeue,
137         .dispatch               = (void *) maximal_dispatch,
138         .runnable               = (void *) maximal_runnable,
139         .running                = (void *) maximal_running,
140         .stopping               = (void *) maximal_stopping,
141         .quiescent              = (void *) maximal_quiescent,
142         .yield                  = (void *) maximal_yield,
143         .core_sched_before      = (void *) maximal_core_sched_before,
144         .set_weight             = (void *) maximal_set_weight,
145         .set_cpumask            = (void *) maximal_set_cpumask,
146         .update_idle            = (void *) maximal_update_idle,
147         .cpu_acquire            = (void *) maximal_cpu_acquire,
148         .cpu_release            = (void *) maximal_cpu_release,
149         .cpu_online             = (void *) maximal_cpu_online,
150         .cpu_offline            = (void *) maximal_cpu_offline,
151         .init_task              = (void *) maximal_init_task,
152         .enable                 = (void *) maximal_enable,
153         .exit_task              = (void *) maximal_exit_task,
154         .disable                = (void *) maximal_disable,
155         .cgroup_init            = (void *) maximal_cgroup_init,
156         .cgroup_exit            = (void *) maximal_cgroup_exit,
157         .cgroup_prep_move       = (void *) maximal_cgroup_prep_move,
158         .cgroup_move            = (void *) maximal_cgroup_move,
159         .cgroup_cancel_move     = (void *) maximal_cgroup_cancel_move,
160         .cgroup_set_weight      = (void *) maximal_cgroup_set_weight,
161         .init                   = (void *) maximal_init,
162         .exit                   = (void *) maximal_exit,
163         .name                   = "maximal",
164 };
165 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php