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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Jan 2022 12:28:28 +0530
From:   Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To:     Bharata B Rao <bharata@....com>
Cc:     linux-kernel@...r.kernel.org, mingo@...hat.com,
        peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, riel@...riel.com
Subject: Re: [PATCH] sched/debug: Remove mpol_get/put and task_lock/unlock
 from sched_show_numa

* Bharata B Rao <bharata@....com> [2022-01-18 10:35:15]:

> The older format of /proc/pid/sched printed home node info which
> required the mempolicy and task lock around mpol_get(). However
> the format has changed since then and there is no need for
> sched_show_numa() any more to have mempolicy argument,
> asssociated mpol_get/put and task_lock/unlock. Remove them.
> 

> Fixes: 397f2378f1361 ("sched/numa: Fix numa balancing stats in /proc/pid/sched")
> Signed-off-by: Bharata B Rao <bharata@....com>

Agree. Since pol is now being used, this whole hunk can be removed.

Reviewed-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>

> ---
>  kernel/sched/debug.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index 7dcbaa31c5d9..50e05c8d0d61 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -931,25 +931,15 @@ void print_numa_stats(struct seq_file *m, int node, unsigned long tsf,
>  static void sched_show_numa(struct task_struct *p, struct seq_file *m)
>  {
>  #ifdef CONFIG_NUMA_BALANCING
> -	struct mempolicy *pol;
> -
>  	if (p->mm)
>  		P(mm->numa_scan_seq);
> 
> -	task_lock(p);
> -	pol = p->mempolicy;
> -	if (pol && !(pol->flags & MPOL_F_MORON))
> -		pol = NULL;
> -	mpol_get(pol);
> -	task_unlock(p);
> -
>  	P(numa_pages_migrated);
>  	P(numa_preferred_nid);
>  	P(total_numa_faults);
>  	SEQ_printf(m, "current_node=%d, numa_group_id=%d\n",
>  			task_node(p), task_numa_group_id(p));
>  	show_numa_stats(p, m);
> -	mpol_put(pol);
>  #endif
>  }
> 
> -- 
> 2.25.1
> 

-- 
Thanks and Regards
Srikar Dronamraju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ