Skip to content

Commit 848785d

Browse files
Valentin Schneideringomolnar
authored andcommitted
sched/topology: Move sd_flag_debug out of #ifdef CONFIG_SYSCTL
The last sd_flag_debug shuffle inadvertently moved its definition within an #ifdef CONFIG_SYSCTL region. While CONFIG_SYSCTL is indeed required to produce the sched domain ctl interface (which uses sd_flag_debug to output flag names), it isn't required to run any assertion on the sched_domain hierarchy itself. Move the definition of sd_flag_debug to a CONFIG_SCHED_DEBUG region of topology.c. Now at long last we have: - sd_flag_debug declared in include/linux/sched/topology.h iff CONFIG_SCHED_DEBUG=y - sd_flag_debug defined in kernel/sched/topology.c, conditioned by: - CONFIG_SCHED_DEBUG, with an explicit #ifdef block - CONFIG_SMP, as a requirement to compile topology.c With this change, all symbols pertaining to SD flag metadata (with the exception of __SD_FLAG_CNT) are now defined exclusively within topology.c Fixes: 8fca949 ("sched/topology: Move sd_flag_debug out of linux/sched/topology.h") Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200908184956.23369-1-valentin.schneider@arm.com
1 parent 153908e commit 848785d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

kernel/sched/debug.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,6 @@ set_table_entry(struct ctl_table *entry,
245245
entry->proc_handler = proc_handler;
246246
}
247247

248-
#define SD_FLAG(_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name },
249-
const struct sd_flag_debug sd_flag_debug[] = {
250-
#include <linux/sched/sd_flags.h>
251-
};
252-
#undef SD_FLAG
253-
254248
static int sd_ctl_doflags(struct ctl_table *table, int write,
255249
void *buffer, size_t *lenp, loff_t *ppos)
256250
{

kernel/sched/topology.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ static inline bool sched_debug(void)
2525
return sched_debug_enabled;
2626
}
2727

28+
#define SD_FLAG(_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name },
29+
const struct sd_flag_debug sd_flag_debug[] = {
30+
#include <linux/sched/sd_flags.h>
31+
};
32+
#undef SD_FLAG
33+
2834
static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
2935
struct cpumask *groupmask)
3036
{

0 commit comments

Comments
 (0)