Skip to content

Commit

Permalink
sched/alt: Fix build fail with CONFIG_SMP=n
Browse files Browse the repository at this point in the history
Fix uniprocessor build issue torvalds#101
  • Loading branch information
cchalpha committed Sep 15, 2024
1 parent a1b1758 commit ea33d81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions kernel/sched/alt_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4172,6 +4172,8 @@ void scheduler_tick(void)
wq_worker_tick(curr);
}

#ifdef CONFIG_SMP

static int active_balance_cpu_stop(void *data)
{
struct balance_arg *arg = data;
Expand Down Expand Up @@ -4264,6 +4266,8 @@ static DEFINE_PER_CPU(struct balance_callback, sg_balance_head) = {
};
#endif /* CONFIG_SCHED_SMT */

#endif /* CONFIG_SMP */

#ifdef CONFIG_NO_HZ_FULL

struct tick_work {
Expand Down Expand Up @@ -7667,7 +7671,9 @@ void __init sched_init(void)
{
int i;
struct rq *rq;
#ifdef CONFIG_SCHED_SMT
struct balance_arg balance_arg = {.cpumask = sched_sg_idle_mask, .active = 0};
#endif

printk(KERN_INFO "sched/alt: "ALT_SCHED_NAME" CPU Scheduler "ALT_SCHED_VERSION\
" by Alfred Chen.\n");
Expand Down
4 changes: 0 additions & 4 deletions kernel/sched/alt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,6 @@ static inline int best_mask_cpu(int cpu, const cpumask_t *mask)
return __best_mask_cpu(mask, per_cpu(sched_cpu_topo_masks, cpu));
}

extern void flush_smp_call_function_queue(void);

#else /* !CONFIG_SMP */
static inline void flush_smp_call_function_queue(void) { }
#endif

#ifndef arch_scale_freq_tick
Expand Down

0 comments on commit ea33d81

Please sign in to comment.