Re: linux-next: Tree for Sep 8 (sched/topology.c)

From: Valentin Schneider
Date: Tue Sep 08 2020 - 12:32:42 EST



On 08/09/20 17:07, Valentin Schneider wrote:
> On 08/09/20 16:50, Randy Dunlap wrote:
>> Sure, here it is again. And
>> CONFIG_SMP=y
>> CONFIG_SCHED_DEBUG=y
>>
>> thanks.
>
> Okay so I can reproduce that with GCC-10.1, now to figure out WTH is going on...

Yet another fail from my end, the declaration is conditioned by:

CONFIG_SCHED_DEBUG
CONFIG_SMP
CONFIG_SYSCTL

that last one being ofc stupid. Below lets me build; I'll go get
something with caffeine in it and double-check the shuffles I've done
before sending an actual patch.

Thanks for the report!

---
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 0d7896d2a0b2..0ca486aa296b 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -185,6 +185,12 @@ late_initcall(sched_init_debug);

#ifdef CONFIG_SMP

+#define SD_FLAG(_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name },
+const struct sd_flag_debug sd_flag_debug[] = {
+#include <linux/sched/sd_flags.h>
+};
+#undef SD_FLAG
+
#ifdef CONFIG_SYSCTL

static struct ctl_table sd_ctl_dir[] = {
@@ -245,12 +251,6 @@ set_table_entry(struct ctl_table *entry,
entry->proc_handler = proc_handler;
}

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