Skip to content

Commit 87702a3

Browse files
committed
Merge tag 'sched-urgent-2020-10-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Thomas Gleixner: "Two scheduler fixes: - A trivial build fix for sched_feat() to compile correctly with CONFIG_JUMP_LABEL=n - Replace a zero lenght array with a flexible array" * tag 'sched-urgent-2020-10-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/features: Fix !CONFIG_JUMP_LABEL case sched: Replace zero-length array with flexible-array
2 parents a3d1b31 + a73f863 commit 87702a3

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
4444

4545
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
4646

47-
#if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL)
47+
#ifdef CONFIG_SCHED_DEBUG
4848
/*
4949
* Debugging: various feature bits
5050
*

kernel/sched/sched.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ struct sched_group_capacity {
14711471
int id;
14721472
#endif
14731473

1474-
unsigned long cpumask[0]; /* Balance mask */
1474+
unsigned long cpumask[]; /* Balance mask */
14751475
};
14761476

14771477
struct sched_group {
@@ -1629,14 +1629,15 @@ enum {
16291629

16301630
#undef SCHED_FEAT
16311631

1632-
#if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL)
1632+
#ifdef CONFIG_SCHED_DEBUG
16331633

16341634
/*
16351635
* To support run-time toggling of sched features, all the translation units
16361636
* (but core.c) reference the sysctl_sched_features defined in core.c.
16371637
*/
16381638
extern const_debug unsigned int sysctl_sched_features;
16391639

1640+
#ifdef CONFIG_JUMP_LABEL
16401641
#define SCHED_FEAT(name, enabled) \
16411642
static __always_inline bool static_branch_##name(struct static_key *key) \
16421643
{ \
@@ -1649,7 +1650,13 @@ static __always_inline bool static_branch_##name(struct static_key *key) \
16491650
extern struct static_key sched_feat_keys[__SCHED_FEAT_NR];
16501651
#define sched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x]))
16511652

1652-
#else /* !(SCHED_DEBUG && CONFIG_JUMP_LABEL) */
1653+
#else /* !CONFIG_JUMP_LABEL */
1654+
1655+
#define sched_feat(x) (sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
1656+
1657+
#endif /* CONFIG_JUMP_LABEL */
1658+
1659+
#else /* !SCHED_DEBUG */
16531660

16541661
/*
16551662
* Each translation unit has its own copy of sysctl_sched_features to allow
@@ -1665,7 +1672,7 @@ static const_debug __maybe_unused unsigned int sysctl_sched_features =
16651672

16661673
#define sched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
16671674

1668-
#endif /* SCHED_DEBUG && CONFIG_JUMP_LABEL */
1675+
#endif /* SCHED_DEBUG */
16691676

16701677
extern struct static_key_false sched_numa_balancing;
16711678
extern struct static_key_false sched_schedstats;

0 commit comments

Comments
 (0)