xref: /linux/kernel/sched/ext/idle.h (revision bba2c3615bd6cfee7456d1130f2e6b01b3f4e9ba)
1*bba2c361STejun Heo /* SPDX-License-Identifier: GPL-2.0 */
2*bba2c361STejun Heo /*
3*bba2c361STejun Heo  * BPF extensible scheduler class: Documentation/scheduler/sched-ext.rst
4*bba2c361STejun Heo  *
5*bba2c361STejun Heo  * Copyright (c) 2022 Meta Platforms, Inc. and affiliates.
6*bba2c361STejun Heo  * Copyright (c) 2022 Tejun Heo <tj@kernel.org>
7*bba2c361STejun Heo  * Copyright (c) 2022 David Vernet <dvernet@meta.com>
8*bba2c361STejun Heo  * Copyright (c) 2024 Andrea Righi <arighi@nvidia.com>
9*bba2c361STejun Heo  */
10*bba2c361STejun Heo #ifndef _KERNEL_SCHED_EXT_IDLE_H
11*bba2c361STejun Heo #define _KERNEL_SCHED_EXT_IDLE_H
12*bba2c361STejun Heo 
13*bba2c361STejun Heo struct sched_ext_ops;
14*bba2c361STejun Heo 
15*bba2c361STejun Heo extern struct btf_id_set8 scx_kfunc_ids_idle;
16*bba2c361STejun Heo extern struct btf_id_set8 scx_kfunc_ids_select_cpu;
17*bba2c361STejun Heo 
18*bba2c361STejun Heo void scx_idle_update_selcpu_topology(struct sched_ext_ops *ops);
19*bba2c361STejun Heo void scx_idle_init_masks(void);
20*bba2c361STejun Heo 
21*bba2c361STejun Heo s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
22*bba2c361STejun Heo 		       const struct cpumask *cpus_allowed, u64 flags);
23*bba2c361STejun Heo void scx_idle_enable(struct sched_ext_ops *ops);
24*bba2c361STejun Heo void scx_idle_disable(void);
25*bba2c361STejun Heo int scx_idle_init(void);
26*bba2c361STejun Heo 
27*bba2c361STejun Heo #endif /* _KERNEL_SCHED_EXT_IDLE_H */
28