lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200826142550.GP1891694@smile.fi.intel.com>
Date:   Wed, 26 Aug 2020 17:25:50 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Valentin Schneider <valentin.schneider@....com>
Cc:     linux-kernel@...r.kernel.org, mingo@...nel.org,
        peterz@...radead.org, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, morten.rasmussen@....com
Subject: Re: [PATCH 1/2] sched/topology: Move sd_flag_debug out of
 linux/sched/topology.h

On Tue, Aug 25, 2020 at 02:32:15PM +0100, Valentin Schneider wrote:
> 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.

Tested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

> Fixes: b6e862f38672 ("sched/topology: Define and assign sched_domain flag metadata")
> Reported-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Valentin Schneider <valentin.schneider@....com>
> ---
>  include/linux/sched/topology.h | 9 ++++-----
>  kernel/sched/debug.c           | 6 ++++++
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
> index 2d59ca77103e..b9b0dab4d067 100644
> --- a/include/linux/sched/topology.h
> +++ b/include/linux/sched/topology.h
> @@ -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
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index 0655524700d2..0d7896d2a0b2 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -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)
>  {
> -- 
> 2.27.0
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ