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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c183ab0d-24db-3191-bfd1-a390162cd53c@arm.com>
Date:   Tue, 7 Jun 2022 10:27:28 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Bing Huang <huangbing@...inos.cn>, peterz@...radead.org
Cc:     brauner@...nel.org, bristot@...hat.com, bsegall@...gle.com,
        juri.lelli@...hat.com, linux-kernel@...r.kernel.org,
        mgorman@...e.de, mingo@...hat.com, rostedt@...dmis.org,
        vincent.guittot@...aro.org
Subject: Re: [PATCH v3] sched/fair: static cpumasks for load balance

On 02/06/2022 05:01, Bing Huang wrote:
> The both cpu mask load_balance_mask and select_idle_mask just only used
> in fair.c, but allocation in core.c in CONFIG_CPUMASK_OFFSTACK=y case,
> and global via declare per cpu variations. More or less, it looks wired.

Maybe you can change this into:

sched/fair: Make per-cpu cpumasks static

load_balance_mask and select_idle_mask are only used in fair.c. Make
them static and move their allocation into init_sched_fair_class().

Replace kzalloc_node() with zalloc_cpumask_var_node() to get rid of the
CONFIG_CPUMASK_OFFSTACK #ifdef and to align with per-cpu cpumask
allocation for RT (local_cpu_mask in init_sched_rt_class()) and DL
class (local_cpu_mask_dl in init_sched_dl_class()).

> Co-developed-by: Dietmar Eggemann <dietmar.eggemann@....com>

You can remove the `Co-developed-by`. I was just reviewing the patch and
gave suggestions.

[...]

> @@ -11841,6 +11841,15 @@ void show_numa_stats(struct task_struct *p, struct seq_file *m)
>  __init void init_sched_fair_class(void)
>  {
>  #ifdef CONFIG_SMP
> +	int i;
> +
> +	for_each_possible_cpu(i) {
> +		zalloc_cpumask_var_node(&per_cpu(load_balance_mask, i),
> +								GFP_KERNEL, cpu_to_node(i));
> +		zalloc_cpumask_var_node(&per_cpu(select_idle_mask, i),
> +								GFP_KERNEL, cpu_to_node(i));

@@ -11815,9 +11815,9 @@ __init void init_sched_fair_class(void)
 
        for_each_possible_cpu(i) {
                zalloc_cpumask_var_node(&per_cpu(load_balance_mask, i),
-                                                               GFP_KERNEL, cpu_to_node(i));
+                                       GFP_KERNEL, cpu_to_node(i));
                zalloc_cpumask_var_node(&per_cpu(select_idle_mask, i),
-                                                               GFP_KERNEL, cpu_to_node(i));
+                                       GFP_KERNEL, cpu_to_node(i));
        }

[...]

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ