sched/topology: Move sd_flag_debug out of linux/sched/topology.h
PATCH 1/2 sched/topology: Move sd_flag_debug out of linux/sched/topology.h
Defining an array in a header imported all over the place clearly is a daft idea, that still didn't stop me from doing it.
Leave a declaration of sd_flag_debug in topology.h and move its definition to sched/debug.c.
--- include/linux/sched/topology.h | 9 ++++----- kernel/sched/debug.c | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-)
include/linux/sched/topology.h +4 -5
@@ -33,14 +33,13 @@ static const unsigned int SD_DEGENERATE_GROUPS_MASK =#undef SD_FLAG#ifdef CONFIG_SCHED_DEBUG -#define SD_FLAG (_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name }, -static const struct { + +struct sd_flag_debug {unsigned int meta_flags;char *name; -} sd_flag_debug[] = { -#include <linux/sched/sd_flags.h> }; -#undef SD_FLAG +extern const struct sd_flag_debug sd_flag_debug[]; +#endif #ifdef CONFIG_SCHED_SMT
kernel/sched/debug.c +6 -0
@@ -245,6 +245,12 @@ 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) {
Signature · 1 line
2.27.0
PATCH 2/2 sched/topology: Move SD_DEGENERATE_GROUPS_MASK out of linux/sched/topology.h
SD_DEGENERATE_GROUPS_MASK is only useful for sched/topology.c, but still gets defined for anyone who imports topology.h, leading to a flurry of unused variable warnings.
Move it out of the header and place it next to the SD degeneration functions in sched/topology.c.
--- include/linux/sched/topology.h | 7 ------- kernel/sched/topology.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)
include/linux/sched/topology.h +0 -7
@@ -25,13 +25,6 @@ enum { };#undef SD_FLAG -/* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */ -#define SD_FLAG (name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) | -static const unsigned int SD_DEGENERATE_GROUPS_MASK = -#include <linux/sched/sd_flags.h> -0 ; -#undef SD_FLAG -#ifdef CONFIG_SCHED_DEBUG struct sd_flag_debug {
kernel/sched/topology.c +7 -0
@@ -154,6 +154,13 @@ static inline bool sched_debug(void) }#endif /* CONFIG_SCHED_DEBUG */ +/* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */ +#define SD_FLAG (name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) | +static const unsigned int SD_DEGENERATE_GROUPS_MASK = +#include <linux/sched/sd_flags.h> +0 ; +#undef SD_FLAG +static int sd_degenerate (struct sched_domain *sd) {if (cpumask_weight (sched_domain_span (sd)) ==1 )
Signature · 1 line
2.27.0
Re: [PATCH 2/2] sched/topology: Move SD_DEGENERATE_GROUPS_MASK out of linux/sched/topology.h
Quoted 6 lines · Valentin Schneider
SD_DEGENERATE_GROUPS_MASKis only useful forsched/topology.c, but still gets defined for anyone who importstopology.h, leading to a flurry of unused variable warnings.Move it out of the header and place it next to the SD degeneration functions in
sched/topology.c.
Quoted 47 lines
Fixes 4ee4ea443a5d ("sched/topology: Introduce SD metaflag for flags needing > 1 groups")Reported-by Andy Shevchenko <[email protected]>Signed-off-by Valentin Schneider <[email protected]>--- include/linux/sched/topology.h | 7 ------- kernel/sched/topology.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)include/linux/sched/topology.h +0
-7@@ -25,13 +25,6 @@ enum { };#undef SD_FLAG -/* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */ -#define SD_FLAG (name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) | -static const unsigned int SD_DEGENERATE_GROUPS_MASK = -#include <linux/sched/sd_flags.h> -0 ; -#undef SD_FLAG -#ifdef CONFIG_SCHED_DEBUG struct sd_flag_debug {kernel/sched/topology.c +7
-0@@ -154,6 +154,13 @@ static inline bool sched_debug(void) }#endif /* CONFIG_SCHED_DEBUG */ +/* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */ +#define SD_FLAG (name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) | +static const unsigned int SD_DEGENERATE_GROUPS_MASK = +#include <linux/sched/sd_flags.h> +0 ; +#undef SD_FLAG +static int sd_degenerate (struct sched_domain *sd) {if (cpumask_weight (sched_domain_span (sd)) ==1 )Signature · 1 line
2.27.0
Signature · 2 lines
With Best Regards, Andy Shevchenko
[tip: sched/core] sched/topology: Move SD_DEGENERATE_GROUPS_MASK out of linux/sched/topology.h
In reply to Valentin SchneiderThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 4fc472f1214ef75e5450f207e23ff13af6eecad4 Gitweb: https://git.kernel.org/tip/4fc472f1214ef75e5450f207e23ff13af6eecad4 Author: Valentin Schneider <[email protected]> AuthorDate: Tue, 25 Aug 2020 14:32:16 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Wed, 26 Aug 2020 12:41:59 +02:00
sched/topology: Move SD_DEGENERATE_GROUPS_MASK out of linux/sched/topology.h
SD_DEGENERATE_GROUPS_MASK is only useful for sched/topology.c, but still gets defined for anyone who imports topology.h, leading to a flurry of unused variable warnings.
Move it out of the header and place it next to the SD degeneration functions in sched/topology.c.
--- include/linux/sched/topology.h | 7 ------- kernel/sched/topology.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)
include/linux/sched/topology.h +0 -7
@@ -25,13 +25,6 @@ enum { };#undef SD_FLAG -/* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */ -#define SD_FLAG (name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) | -static const unsigned int SD_DEGENERATE_GROUPS_MASK = -#include <linux/sched/sd_flags.h> -0 ; -#undef SD_FLAG -#ifdef CONFIG_SCHED_DEBUG struct sd_flag_debug {
kernel/sched/topology.c +7 -0
@@ -154,6 +154,13 @@ static inline bool sched_debug(void) }#endif /* CONFIG_SCHED_DEBUG */ +/* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */ +#define SD_FLAG (name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) | +static const unsigned int SD_DEGENERATE_GROUPS_MASK = +#include <linux/sched/sd_flags.h> +0 ; +#undef SD_FLAG +static int sd_degenerate (struct sched_domain *sd) {if (cpumask_weight (sched_domain_span (sd)) ==1 )
Quoted 5 lines · Valentin Schneider
Defining an array in a header imported all over the place clearly is a daft idea, that still didn't stop me from doing it.
Leave a declaration of
sd_flag_debugintopology.hand move its definition tosched/debug.c.
Quoted 51 lines
Fixes b6e862f38672 ("sched/topology: Define and assign sched_domain flag metadata")Reported-by Andy Shevchenko <[email protected]>Signed-off-by Valentin Schneider <[email protected]>--- include/linux/sched/topology.h | 9 ++++----- kernel/sched/debug.c | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-)include/linux/sched/topology.h +4
-5@@ -33,14 +33,13 @@ static const unsigned int SD_DEGENERATE_GROUPS_MASK =#undef SD_FLAG#ifdef CONFIG_SCHED_DEBUG -#define SD_FLAG (_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name }, -static const struct { + +struct sd_flag_debug {unsigned int meta_flags;char *name; -} sd_flag_debug[] = { -#include <linux/sched/sd_flags.h> }; -#undef SD_FLAG +extern const struct sd_flag_debug sd_flag_debug[]; +#endif #ifdef CONFIG_SCHED_SMT kernel/sched/debug.c +6
-0@@ -245,6 +245,12 @@ 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) {Signature · 1 line
2.27.0
Signature · 2 lines
With Best Regards, Andy Shevchenko
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 8fca9494d4b4d6b57b1398cd473feb308df656db Gitweb: https://git.kernel.org/tip/8fca9494d4b4d6b57b1398cd473feb308df656db Author: Valentin Schneider <[email protected]> AuthorDate: Tue, 25 Aug 2020 14:32:15 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Wed, 26 Aug 2020 12:41:59 +02:00
sched/topology: Move sd_flag_debug out of linux/sched/topology.h
Defining an array in a header imported all over the place clearly is a daft idea, that still didn't stop me from doing it.
Leave a declaration of sd_flag_debug in topology.h and move its definition to sched/debug.c.
--- include/linux/sched/topology.h | 9 ++++----- kernel/sched/debug.c | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-)
include/linux/sched/topology.h +4 -5
@@ -33,14 +33,13 @@ static const unsigned int SD_DEGENERATE_GROUPS_MASK =#undef SD_FLAG#ifdef CONFIG_SCHED_DEBUG -#define SD_FLAG (_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name }, -static const struct { + +struct sd_flag_debug {unsigned int meta_flags;char *name; -} sd_flag_debug[] = { -#include <linux/sched/sd_flags.h> }; -#undef SD_FLAG +extern const struct sd_flag_debug sd_flag_debug[]; +#endif #ifdef CONFIG_SCHED_SMT
kernel/sched/debug.c +6 -0
@@ -245,6 +245,12 @@ 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) {
Quoted 8 lines · On Thu, Aug 27, 2020 at 10:57 AM tip-bot2 for Valentin Schneider…
The following commit has been merged into the sched/core branch of tip:
Fixes b6e862f38672 ("sched/topology: Define and assign sched_domain flag metadata")Reported-by Andy Shevchenko <[email protected]>Signed-off-by Valentin Schneider <[email protected]>Signed-off-by Peter Zijlstra (Intel) <[email protected]>
Hmm... I'm wondering if this bot is aware of tags given afterwards in the thread?
Signature · 2 lines
With Best Regards, Andy Shevchenko
[email protected]
maintainerQuoted 5 lines · Andy Shevchenko
Quoted 2 lines · On Thu, Aug 27, 2020 at 10:57 AM tip-bot2 for Valentin Schneider…
The following commit has been merged into the sched/core branch of tip:
Quoted 8 lines
Quoted 5 lines
Fixes b6e862f38672 ("sched/topology: Define and assign sched_domain flag metadata")Reported-by Andy Shevchenko <[email protected]>Signed-off-by Valentin Schneider <[email protected]>Signed-off-by Peter Zijlstra (Intel) <[email protected]>Hmm... I'm wondering if this bot is aware of tags given afterwards in the thread?
Sorry, your tag came in after I'd already queued the lot.
Quoted 13 lines · On Thu, Aug 27, 2020 at 12:27 PM <[email protected]> wrote:
Quoted 11 lines · Andy Shevchenko
Quoted 8 lines · On Thu, Aug 27, 2020 at 10:57 AM tip-bot2 for Valentin Schneider…
The following commit has been merged into the sched/core branch of tip:
Fixes b6e862f38672 ("sched/topology: Define and assign sched_domain flag metadata")Reported-by Andy Shevchenko <[email protected]>Signed-off-by Valentin Schneider <[email protected]>Signed-off-by Peter Zijlstra (Intel) <[email protected]>
Quoted 4 lines
Quoted 2 lines
Hmm... I'm wondering if this bot is aware of tags given afterwards in the thread?
Sorry, your tag came in after I'd already queued the lot.
No problem, just was wondering!
Signature · 2 lines
With Best Regards, Andy Shevchenko