Skip to content

Commit 9ec5e0b

Browse files
committed
Merge branch 'sched/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into for-6.17
2 parents 9465f44 + dabe1be commit 9ec5e0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+318
-999
lines changed

include/linux/preempt.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ static inline void preempt_notifier_init(struct preempt_notifier *notifier,
369369

370370
#endif
371371

372-
#ifdef CONFIG_SMP
373-
374372
/*
375373
* Migrate-Disable and why it is undesired.
376374
*
@@ -429,13 +427,6 @@ static inline void preempt_notifier_init(struct preempt_notifier *notifier,
429427
extern void migrate_disable(void);
430428
extern void migrate_enable(void);
431429

432-
#else
433-
434-
static inline void migrate_disable(void) { }
435-
static inline void migrate_enable(void) { }
436-
437-
#endif /* CONFIG_SMP */
438-
439430
/**
440431
* preempt_disable_nested - Disable preemption inside a normally preempt disabled section
441432
*

include/linux/sched.h

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,10 @@ enum uclamp_id {
395395
UCLAMP_CNT
396396
};
397397

398-
#ifdef CONFIG_SMP
399398
extern struct root_domain def_root_domain;
400399
extern struct mutex sched_domains_mutex;
401400
extern void sched_domains_mutex_lock(void);
402401
extern void sched_domains_mutex_unlock(void);
403-
#else
404-
static inline void sched_domains_mutex_lock(void) { }
405-
static inline void sched_domains_mutex_unlock(void) { }
406-
#endif
407402

408403
struct sched_param {
409404
int sched_priority;
@@ -604,15 +599,13 @@ struct sched_entity {
604599
unsigned long runnable_weight;
605600
#endif
606601

607-
#ifdef CONFIG_SMP
608602
/*
609603
* Per entity load average tracking.
610604
*
611605
* Put into separate cache line so it does not
612606
* collide with read-mostly values above.
613607
*/
614608
struct sched_avg avg;
615-
#endif
616609
};
617610

618611
struct sched_rt_entity {
@@ -842,7 +835,6 @@ struct task_struct {
842835
struct alloc_tag *alloc_tag;
843836
#endif
844837

845-
#ifdef CONFIG_SMP
846838
int on_cpu;
847839
struct __call_single_node wake_entry;
848840
unsigned int wakee_flips;
@@ -858,7 +850,6 @@ struct task_struct {
858850
*/
859851
int recent_used_cpu;
860852
int wake_cpu;
861-
#endif
862853
int on_rq;
863854

864855
int prio;
@@ -917,9 +908,7 @@ struct task_struct {
917908
cpumask_t *user_cpus_ptr;
918909
cpumask_t cpus_mask;
919910
void *migration_pending;
920-
#ifdef CONFIG_SMP
921911
unsigned short migration_disabled;
922-
#endif
923912
unsigned short migration_flags;
924913

925914
#ifdef CONFIG_PREEMPT_RCU
@@ -951,10 +940,8 @@ struct task_struct {
951940
struct sched_info sched_info;
952941

953942
struct list_head tasks;
954-
#ifdef CONFIG_SMP
955943
struct plist_node pushable_tasks;
956944
struct rb_node pushable_dl_tasks;
957-
#endif
958945

959946
struct mm_struct *mm;
960947
struct mm_struct *active_mm;
@@ -1778,12 +1765,8 @@ extern struct pid *cad_pid;
17781765

17791766
static __always_inline bool is_percpu_thread(void)
17801767
{
1781-
#ifdef CONFIG_SMP
17821768
return (current->flags & PF_NO_SETAFFINITY) &&
17831769
(current->nr_cpus_allowed == 1);
1784-
#else
1785-
return true;
1786-
#endif
17871770
}
17881771

17891772
/* Per-process atomic flags. */
@@ -1848,7 +1831,6 @@ extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpu
18481831
extern int task_can_attach(struct task_struct *p);
18491832
extern int dl_bw_alloc(int cpu, u64 dl_bw);
18501833
extern void dl_bw_free(int cpu, u64 dl_bw);
1851-
#ifdef CONFIG_SMP
18521834

18531835
/* do_set_cpus_allowed() - consider using set_cpus_allowed_ptr() instead */
18541836
extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask);
@@ -1866,33 +1848,6 @@ extern void release_user_cpus_ptr(struct task_struct *p);
18661848
extern int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask);
18671849
extern void force_compatible_cpus_allowed_ptr(struct task_struct *p);
18681850
extern void relax_compatible_cpus_allowed_ptr(struct task_struct *p);
1869-
#else
1870-
static inline void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
1871-
{
1872-
}
1873-
static inline int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
1874-
{
1875-
/* Opencoded cpumask_test_cpu(0, new_mask) to avoid dependency on cpumask.h */
1876-
if ((*cpumask_bits(new_mask) & 1) == 0)
1877-
return -EINVAL;
1878-
return 0;
1879-
}
1880-
static inline int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node)
1881-
{
1882-
if (src->user_cpus_ptr)
1883-
return -EINVAL;
1884-
return 0;
1885-
}
1886-
static inline void release_user_cpus_ptr(struct task_struct *p)
1887-
{
1888-
WARN_ON(p->user_cpus_ptr);
1889-
}
1890-
1891-
static inline int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask)
1892-
{
1893-
return 0;
1894-
}
1895-
#endif
18961851

18971852
extern int yield_to(struct task_struct *p, bool preempt);
18981853
extern void set_user_nice(struct task_struct *p, long nice);
@@ -1981,11 +1936,7 @@ extern int wake_up_state(struct task_struct *tsk, unsigned int state);
19811936
extern int wake_up_process(struct task_struct *tsk);
19821937
extern void wake_up_new_task(struct task_struct *tsk);
19831938

1984-
#ifdef CONFIG_SMP
19851939
extern void kick_process(struct task_struct *tsk);
1986-
#else
1987-
static inline void kick_process(struct task_struct *tsk) { }
1988-
#endif
19891940

19901941
extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
19911942
#define set_task_comm(tsk, from) ({ \
@@ -2012,7 +1963,6 @@ extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec
20121963
buf; \
20131964
})
20141965

2015-
#ifdef CONFIG_SMP
20161966
static __always_inline void scheduler_ipi(void)
20171967
{
20181968
/*
@@ -2022,9 +1972,6 @@ static __always_inline void scheduler_ipi(void)
20221972
*/
20231973
preempt_fold_need_resched();
20241974
}
2025-
#else
2026-
static inline void scheduler_ipi(void) { }
2027-
#endif
20281975

20291976
extern unsigned long wait_task_inactive(struct task_struct *, unsigned int match_state);
20301977

@@ -2230,7 +2177,6 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
22302177
#define TASK_SIZE_OF(tsk) TASK_SIZE
22312178
#endif
22322179

2233-
#ifdef CONFIG_SMP
22342180
static inline bool owner_on_cpu(struct task_struct *owner)
22352181
{
22362182
/*
@@ -2242,7 +2188,6 @@ static inline bool owner_on_cpu(struct task_struct *owner)
22422188

22432189
/* Returns effective CPU energy utilization, as seen by the scheduler */
22442190
unsigned long sched_cpu_util(int cpu);
2245-
#endif /* CONFIG_SMP */
22462191

22472192
#ifdef CONFIG_SCHED_CORE
22482193
extern void sched_core_free(struct task_struct *tsk);

include/linux/sched/deadline.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ static inline bool dl_time_before(u64 a, u64 b)
2929
return (s64)(a - b) < 0;
3030
}
3131

32-
#ifdef CONFIG_SMP
33-
3432
struct root_domain;
3533
extern void dl_add_task_root_domain(struct task_struct *p);
3634
extern void dl_clear_root_domain(struct root_domain *rd);
3735
extern void dl_clear_root_domain_cpu(int cpu);
3836

39-
#endif /* CONFIG_SMP */
40-
4137
extern u64 dl_cookie;
4238
extern bool dl_bw_visited(int cpu, u64 cookie);
4339

include/linux/sched/idle.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ enum cpu_idle_type {
1111
CPU_MAX_IDLE_TYPES
1212
};
1313

14-
#ifdef CONFIG_SMP
1514
extern void wake_up_if_idle(int cpu);
16-
#else
17-
static inline void wake_up_if_idle(int cpu) { }
18-
#endif
1915

2016
/*
2117
* Idle thread specific functions to determine the need_resched

include/linux/sched/nohz.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* This is the interface between the scheduler and nohz/dynticks:
77
*/
88

9-
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
9+
#ifdef CONFIG_NO_HZ_COMMON
1010
extern void nohz_balance_enter_idle(int cpu);
1111
extern int get_nohz_timer_target(void);
1212
#else
@@ -23,7 +23,7 @@ static inline void calc_load_nohz_remote(struct rq *rq) { }
2323
static inline void calc_load_nohz_stop(void) { }
2424
#endif /* CONFIG_NO_HZ_COMMON */
2525

26-
#if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP)
26+
#ifdef CONFIG_NO_HZ_COMMON
2727
extern void wake_up_nohz_cpu(int cpu);
2828
#else
2929
static inline void wake_up_nohz_cpu(int cpu) { }

include/linux/sched/task.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,7 @@ int kernel_wait(pid_t pid, int *stat);
109109
extern void free_task(struct task_struct *tsk);
110110

111111
/* sched_exec is called by processes performing an exec */
112-
#ifdef CONFIG_SMP
113112
extern void sched_exec(void);
114-
#else
115-
#define sched_exec() {}
116-
#endif
117113

118114
static inline struct task_struct *get_task_struct(struct task_struct *t)
119115
{

include/linux/sched/topology.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/*
1010
* sched-domains (multiprocessor balancing) declarations:
1111
*/
12-
#ifdef CONFIG_SMP
1312

1413
/* Generate SD flag indexes */
1514
#define SD_FLAG(name, mflags) __##name,
@@ -200,37 +199,6 @@ extern void sched_update_asym_prefer_cpu(int cpu, int old_prio, int new_prio);
200199

201200
# define SD_INIT_NAME(type) .name = #type
202201

203-
#else /* CONFIG_SMP */
204-
205-
struct sched_domain_attr;
206-
207-
static inline void
208-
partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
209-
struct sched_domain_attr *dattr_new)
210-
{
211-
}
212-
213-
static inline bool cpus_equal_capacity(int this_cpu, int that_cpu)
214-
{
215-
return true;
216-
}
217-
218-
static inline bool cpus_share_cache(int this_cpu, int that_cpu)
219-
{
220-
return true;
221-
}
222-
223-
static inline bool cpus_share_resources(int this_cpu, int that_cpu)
224-
{
225-
return true;
226-
}
227-
228-
static inline void sched_update_asym_prefer_cpu(int cpu, int old_prio, int new_prio)
229-
{
230-
}
231-
232-
#endif /* !CONFIG_SMP */
233-
234202
#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
235203
extern void rebuild_sched_domains_energy(void);
236204
#else

kernel/sched/autogroup.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* Auto-group scheduling implementation:
55
*/
66

7+
#include "autogroup.h"
8+
#include "sched.h"
9+
710
unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
811
static struct autogroup autogroup_default;
912
static atomic_t autogroup_seq_nr;
@@ -25,9 +28,9 @@ static void __init sched_autogroup_sysctl_init(void)
2528
{
2629
register_sysctl_init("kernel", sched_autogroup_sysctls);
2730
}
28-
#else
31+
#else /* !CONFIG_SYSCTL: */
2932
#define sched_autogroup_sysctl_init() do { } while (0)
30-
#endif
33+
#endif /* !CONFIG_SYSCTL */
3134

3235
void __init autogroup_init(struct task_struct *init_task)
3336
{
@@ -108,7 +111,7 @@ static inline struct autogroup *autogroup_create(void)
108111
free_rt_sched_group(tg);
109112
tg->rt_se = root_task_group.rt_se;
110113
tg->rt_rq = root_task_group.rt_rq;
111-
#endif
114+
#endif /* CONFIG_RT_GROUP_SCHED */
112115
tg->autogroup = ag;
113116

114117
sched_online_group(tg, &root_task_group);

kernel/sched/autogroup.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _KERNEL_SCHED_AUTOGROUP_H
33
#define _KERNEL_SCHED_AUTOGROUP_H
44

5+
#include "sched.h"
6+
57
#ifdef CONFIG_SCHED_AUTOGROUP
68

79
struct autogroup {
@@ -41,7 +43,7 @@ autogroup_task_group(struct task_struct *p, struct task_group *tg)
4143

4244
extern int autogroup_path(struct task_group *tg, char *buf, int buflen);
4345

44-
#else /* !CONFIG_SCHED_AUTOGROUP */
46+
#else /* !CONFIG_SCHED_AUTOGROUP: */
4547

4648
static inline void autogroup_init(struct task_struct *init_task) { }
4749
static inline void autogroup_free(struct task_group *tg) { }
@@ -61,6 +63,6 @@ static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
6163
return 0;
6264
}
6365

64-
#endif /* CONFIG_SCHED_AUTOGROUP */
66+
#endif /* !CONFIG_SCHED_AUTOGROUP */
6567

6668
#endif /* _KERNEL_SCHED_AUTOGROUP_H */

kernel/sched/build_policy.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@
5050
#include "idle.c"
5151

5252
#include "rt.c"
53+
#include "cpudeadline.c"
5354

54-
#ifdef CONFIG_SMP
55-
# include "cpudeadline.c"
56-
# include "pelt.c"
57-
#endif
55+
#include "pelt.c"
5856

5957
#include "cputime.c"
6058
#include "deadline.c"

0 commit comments

Comments
 (0)