mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
sched: Clean up and standardize #if/#else/#endif markers in sched/sched.h
- Use the standard #ifdef marker format for larger blocks,
where appropriate:
#if CONFIG_FOO
...
#else /* !CONFIG_FOO: */
...
#endif /* !CONFIG_FOO */
- Fix whitespace noise and other inconsistencies.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20250528080924.2273858-16-mingo@kernel.org
This commit is contained in:
parent
3eca109a78
commit
fdccd0c792
|
|
@ -425,7 +425,7 @@ struct cfs_bandwidth {
|
|||
int nr_burst;
|
||||
u64 throttled_time;
|
||||
u64 burst_time;
|
||||
#endif
|
||||
#endif /* CONFIG_CFS_BANDWIDTH */
|
||||
};
|
||||
|
||||
/* Task group related information */
|
||||
|
|
@ -443,15 +443,15 @@ struct task_group {
|
|||
/* runqueue "owned" by this group on each CPU */
|
||||
struct cfs_rq **cfs_rq;
|
||||
unsigned long shares;
|
||||
#ifdef CONFIG_SMP
|
||||
#ifdef CONFIG_SMP
|
||||
/*
|
||||
* load_avg can be heavily contended at clock tick time, so put
|
||||
* it in its own cache-line separated from the fields above which
|
||||
* will also be accessed at each tick.
|
||||
*/
|
||||
atomic_long_t load_avg ____cacheline_aligned;
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CONFIG_SMP */
|
||||
#endif /* CONFIG_FAIR_GROUP_SCHED */
|
||||
|
||||
#ifdef CONFIG_RT_GROUP_SCHED
|
||||
struct sched_rt_entity **rt_se;
|
||||
|
|
@ -532,7 +532,7 @@ extern void free_fair_sched_group(struct task_group *tg);
|
|||
extern int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent);
|
||||
extern void online_fair_sched_group(struct task_group *tg);
|
||||
extern void unregister_fair_sched_group(struct task_group *tg);
|
||||
#else
|
||||
#else /* !CONFIG_FAIR_GROUP_SCHED: */
|
||||
static inline void free_fair_sched_group(struct task_group *tg) { }
|
||||
static inline int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
|
||||
{
|
||||
|
|
@ -540,7 +540,7 @@ static inline int alloc_fair_sched_group(struct task_group *tg, struct task_grou
|
|||
}
|
||||
static inline void online_fair_sched_group(struct task_group *tg) { }
|
||||
static inline void unregister_fair_sched_group(struct task_group *tg) { }
|
||||
#endif
|
||||
#endif /* !CONFIG_FAIR_GROUP_SCHED */
|
||||
|
||||
extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
|
||||
struct sched_entity *se, int cpu,
|
||||
|
|
@ -577,22 +577,22 @@ extern int sched_group_set_idle(struct task_group *tg, long idle);
|
|||
#ifdef CONFIG_SMP
|
||||
extern void set_task_rq_fair(struct sched_entity *se,
|
||||
struct cfs_rq *prev, struct cfs_rq *next);
|
||||
#else /* !CONFIG_SMP */
|
||||
#else /* !CONFIG_SMP: */
|
||||
static inline void set_task_rq_fair(struct sched_entity *se,
|
||||
struct cfs_rq *prev, struct cfs_rq *next) { }
|
||||
#endif /* CONFIG_SMP */
|
||||
#else /* !CONFIG_FAIR_GROUP_SCHED */
|
||||
#endif /* !CONFIG_SMP */
|
||||
#else /* !CONFIG_FAIR_GROUP_SCHED: */
|
||||
static inline int sched_group_set_shares(struct task_group *tg, unsigned long shares) { return 0; }
|
||||
static inline int sched_group_set_idle(struct task_group *tg, long idle) { return 0; }
|
||||
#endif /* CONFIG_FAIR_GROUP_SCHED */
|
||||
#endif /* !CONFIG_FAIR_GROUP_SCHED */
|
||||
|
||||
#else /* CONFIG_CGROUP_SCHED */
|
||||
#else /* !CONFIG_CGROUP_SCHED: */
|
||||
|
||||
struct cfs_bandwidth { };
|
||||
|
||||
static inline bool cfs_task_bw_constrained(struct task_struct *p) { return false; }
|
||||
|
||||
#endif /* CONFIG_CGROUP_SCHED */
|
||||
#endif /* !CONFIG_CGROUP_SCHED */
|
||||
|
||||
extern void unregister_rt_sched_group(struct task_group *tg);
|
||||
extern void free_rt_sched_group(struct task_group *tg);
|
||||
|
|
@ -860,9 +860,9 @@ struct dl_rq {
|
|||
* of the leftmost (earliest deadline) element.
|
||||
*/
|
||||
struct rb_root_cached pushable_dl_tasks_root;
|
||||
#else
|
||||
#else /* !CONFIG_SMP: */
|
||||
struct dl_bw dl_bw;
|
||||
#endif
|
||||
#endif /* !CONFIG_SMP */
|
||||
/*
|
||||
* "Active utilization" for this runqueue: increased when a
|
||||
* task wakes up (becomes TASK_RUNNING) and decreased when a
|
||||
|
|
@ -1009,7 +1009,7 @@ struct root_domain {
|
|||
/* These atomics are updated outside of a lock */
|
||||
atomic_t rto_loop_next;
|
||||
atomic_t rto_loop_start;
|
||||
#endif
|
||||
#endif /* HAVE_RT_PUSH_IPI */
|
||||
/*
|
||||
* The "RT overload" flag: it gets set if a CPU has more than
|
||||
* one runnable RT task.
|
||||
|
|
@ -1295,7 +1295,7 @@ struct rq {
|
|||
unsigned int core_forceidle_seq;
|
||||
unsigned int core_forceidle_occupation;
|
||||
u64 core_forceidle_start;
|
||||
#endif
|
||||
#endif /* CONFIG_SCHED_CORE */
|
||||
|
||||
/* Scratch cpumask to be temporarily used under rq_lock */
|
||||
cpumask_var_t scratch_mask;
|
||||
|
|
@ -1314,13 +1314,13 @@ static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
|
|||
return cfs_rq->rq;
|
||||
}
|
||||
|
||||
#else
|
||||
#else /* !CONFIG_FAIR_GROUP_SCHED: */
|
||||
|
||||
static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
|
||||
{
|
||||
return container_of(cfs_rq, struct rq, cfs);
|
||||
}
|
||||
#endif
|
||||
#endif /* !CONFIG_FAIR_GROUP_SCHED */
|
||||
|
||||
static inline int cpu_of(struct rq *rq)
|
||||
{
|
||||
|
|
@ -1501,6 +1501,7 @@ static inline bool sched_group_cookie_match(struct rq *rq,
|
|||
}
|
||||
|
||||
#endif /* !CONFIG_SCHED_CORE */
|
||||
|
||||
#ifdef CONFIG_RT_GROUP_SCHED
|
||||
# ifdef CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED
|
||||
DECLARE_STATIC_KEY_FALSE(rt_group_sched);
|
||||
|
|
@ -1508,16 +1509,16 @@ static inline bool rt_group_sched_enabled(void)
|
|||
{
|
||||
return static_branch_unlikely(&rt_group_sched);
|
||||
}
|
||||
# else
|
||||
# else /* !CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED: */
|
||||
DECLARE_STATIC_KEY_TRUE(rt_group_sched);
|
||||
static inline bool rt_group_sched_enabled(void)
|
||||
{
|
||||
return static_branch_likely(&rt_group_sched);
|
||||
}
|
||||
# endif /* CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED */
|
||||
#else
|
||||
# endif /* !CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED */
|
||||
#else /* !CONFIG_RT_GROUP_SCHED: */
|
||||
# define rt_group_sched_enabled() false
|
||||
#endif /* CONFIG_RT_GROUP_SCHED */
|
||||
#endif /* !CONFIG_RT_GROUP_SCHED */
|
||||
|
||||
static inline void lockdep_assert_rq_held(struct rq *rq)
|
||||
{
|
||||
|
|
@ -1575,9 +1576,9 @@ static inline void update_idle_core(struct rq *rq)
|
|||
__update_idle_core(rq);
|
||||
}
|
||||
|
||||
#else
|
||||
#else /* !CONFIG_SCHED_SMT: */
|
||||
static inline void update_idle_core(struct rq *rq) { }
|
||||
#endif
|
||||
#endif /* !CONFIG_SCHED_SMT */
|
||||
|
||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
||||
|
||||
|
|
@ -1758,7 +1759,7 @@ static inline void scx_rq_clock_invalidate(struct rq *rq)
|
|||
WRITE_ONCE(rq->scx.flags, rq->scx.flags & ~SCX_RQ_CLK_VALID);
|
||||
}
|
||||
|
||||
#else /* !CONFIG_SCHED_CLASS_EXT */
|
||||
#else /* !CONFIG_SCHED_CLASS_EXT: */
|
||||
#define scx_enabled() false
|
||||
#define scx_switched_all() false
|
||||
|
||||
|
|
@ -2175,7 +2176,7 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
|
|||
tg = &root_task_group;
|
||||
p->rt.rt_rq = tg->rt_rq[cpu];
|
||||
p->rt.parent = tg->rt_se[cpu];
|
||||
#endif
|
||||
#endif /* CONFIG_RT_GROUP_SCHED */
|
||||
}
|
||||
|
||||
#else /* !CONFIG_CGROUP_SCHED: */
|
||||
|
|
@ -2201,7 +2202,7 @@ static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
|
|||
smp_wmb();
|
||||
WRITE_ONCE(task_thread_info(p)->cpu, cpu);
|
||||
p->wake_cpu = cpu;
|
||||
#endif
|
||||
#endif /* CONFIG_SMP */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2430,7 +2431,7 @@ struct sched_class {
|
|||
void (*rq_offline)(struct rq *rq);
|
||||
|
||||
struct rq *(*find_lock_rq)(struct task_struct *p, struct rq *rq);
|
||||
#endif
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
void (*task_tick)(struct rq *rq, struct task_struct *p, int queued);
|
||||
void (*task_fork)(struct task_struct *p);
|
||||
|
|
@ -2955,7 +2956,7 @@ static inline bool rq_order_less(struct rq *rq1, struct rq *rq2)
|
|||
/*
|
||||
* __sched_core_flip() relies on SMT having cpu-id lock order.
|
||||
*/
|
||||
#endif
|
||||
#endif /* CONFIG_SCHED_CORE */
|
||||
return rq1->cpu < rq2->cpu;
|
||||
}
|
||||
|
||||
|
|
@ -3146,6 +3147,7 @@ extern void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq);
|
|||
extern void print_dl_rq(struct seq_file *m, int cpu, struct dl_rq *dl_rq);
|
||||
|
||||
extern void resched_latency_warn(int cpu, u64 latency);
|
||||
|
||||
#ifdef CONFIG_NUMA_BALANCING
|
||||
extern void show_numa_stats(struct task_struct *p, struct seq_file *m);
|
||||
extern void
|
||||
|
|
@ -3255,14 +3257,14 @@ static inline u64 irq_time_read(int cpu)
|
|||
return total;
|
||||
}
|
||||
|
||||
#else
|
||||
#else /* !CONFIG_IRQ_TIME_ACCOUNTING: */
|
||||
|
||||
static inline int irqtime_enabled(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IRQ_TIME_ACCOUNTING */
|
||||
#endif /* !CONFIG_IRQ_TIME_ACCOUNTING */
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
|
||||
|
|
@ -3356,9 +3358,9 @@ static inline unsigned long cpu_util_rt(struct rq *rq)
|
|||
return READ_ONCE(rq->avg_rt.util_avg);
|
||||
}
|
||||
|
||||
#else /* !CONFIG_SMP */
|
||||
#else /* !CONFIG_SMP: */
|
||||
static inline bool update_other_load_avgs(struct rq *rq) { return false; }
|
||||
#endif /* CONFIG_SMP */
|
||||
#endif /* !CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_UCLAMP_TASK
|
||||
|
||||
|
|
@ -3536,13 +3538,13 @@ static inline bool sched_energy_enabled(void)
|
|||
return static_branch_unlikely(&sched_energy_present);
|
||||
}
|
||||
|
||||
#else /* ! (CONFIG_ENERGY_MODEL && CONFIG_CPU_FREQ_GOV_SCHEDUTIL) */
|
||||
#else /* !(CONFIG_ENERGY_MODEL && CONFIG_CPU_FREQ_GOV_SCHEDUTIL): */
|
||||
|
||||
#define perf_domain_span(pd) NULL
|
||||
|
||||
static inline bool sched_energy_enabled(void) { return false; }
|
||||
|
||||
#endif /* CONFIG_ENERGY_MODEL && CONFIG_CPU_FREQ_GOV_SCHEDUTIL */
|
||||
#endif /* !(CONFIG_ENERGY_MODEL && CONFIG_CPU_FREQ_GOV_SCHEDUTIL) */
|
||||
|
||||
#ifdef CONFIG_MEMBARRIER
|
||||
|
||||
|
|
@ -3568,7 +3570,7 @@ static inline void membarrier_switch_mm(struct rq *rq,
|
|||
WRITE_ONCE(rq->membarrier_state, membarrier_state);
|
||||
}
|
||||
|
||||
#else /* !CONFIG_MEMBARRIER :*/
|
||||
#else /* !CONFIG_MEMBARRIER: */
|
||||
|
||||
static inline void membarrier_switch_mm(struct rq *rq,
|
||||
struct mm_struct *prev_mm,
|
||||
|
|
@ -3589,7 +3591,7 @@ static inline bool is_per_cpu_kthread(struct task_struct *p)
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
extern void swake_up_all_locked(struct swait_queue_head *q);
|
||||
extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
||||
|
|
@ -3909,7 +3911,7 @@ bool task_is_pushable(struct rq *rq, struct task_struct *p, int cpu)
|
|||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_RT_MUTEXES
|
||||
|
||||
|
|
@ -3953,7 +3955,7 @@ extern void check_class_changed(struct rq *rq, struct task_struct *p,
|
|||
#ifdef CONFIG_SMP
|
||||
extern struct balance_callback *splice_balance_callbacks(struct rq *rq);
|
||||
extern void balance_callbacks(struct rq *rq, struct balance_callback *head);
|
||||
#else
|
||||
#else /* !CONFIG_SMP: */
|
||||
|
||||
static inline struct balance_callback *splice_balance_callbacks(struct rq *rq)
|
||||
{
|
||||
|
|
@ -3964,7 +3966,7 @@ static inline void balance_callbacks(struct rq *rq, struct balance_callback *hea
|
|||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* !CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_SCHED_CLASS_EXT
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user