1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * BPF extensible scheduler class: Documentation/scheduler/sched-ext.rst
4 *
5 * Copyright (c) 2022 Meta Platforms, Inc. and affiliates.
6 * Copyright (c) 2022 Tejun Heo <tj@kernel.org>
7 * Copyright (c) 2022 David Vernet <dvernet@meta.com>
8 * Copyright (c) 2024 Andrea Righi <arighi@nvidia.com>
9 */
10#ifndef _KERNEL_SCHED_EXT_IDLE_H
11#define _KERNEL_SCHED_EXT_IDLE_H
12
13struct sched_ext_ops;
14
15#ifdef CONFIG_SMP
16void scx_idle_update_selcpu_topology(struct sched_ext_ops *ops);
17void scx_idle_init_masks(void);
18bool scx_idle_test_and_clear_cpu(int cpu);
19s32 scx_pick_idle_cpu(const struct cpumask *cpus_allowed, int node, u64 flags);
20#else /* !CONFIG_SMP */
21static inline void scx_idle_update_selcpu_topology(struct sched_ext_ops *ops) {}
22static inline void scx_idle_init_masks(void) {}
23static inline bool scx_idle_test_and_clear_cpu(int cpu) { return false; }
24static inline s32 scx_pick_idle_cpu(const struct cpumask *cpus_allowed, int node, u64 flags)
25{
26 return -EBUSY;
27}
28#endif /* CONFIG_SMP */
29
30s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
31 const struct cpumask *cpus_allowed, u64 flags);
32void scx_idle_enable(struct sched_ext_ops *ops);
33void scx_idle_disable(void);
34int scx_idle_init(void);
35
36#endif /* _KERNEL_SCHED_EXT_IDLE_H */
37

source code of linux/kernel/sched/ext_idle.h