From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Bharata B Rao <bharata@amd.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, riel@surriel.com
Subject: Re: [PATCH] sched/debug: Remove mpol_get/put and task_lock/unlock from sched_show_numa
Date: Tue, 18 Jan 2022 12:28:28 +0530 [thread overview]
Message-ID: <20220118065828.GA451532@linux.vnet.ibm.com> (raw)
In-Reply-To: <20220118050515.2973-1-bharata@amd.com>
* Bharata B Rao <bharata@amd.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@amd.com>
Agree. Since pol is now being used, this whole hunk can be removed.
Reviewed-by: Srikar Dronamraju <srikar@linux.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
next prev parent reply other threads:[~2022-01-18 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 5:05 Bharata B Rao
2022-01-18 6:58 ` Srikar Dronamraju [this message]
2022-01-18 10:20 ` Mel Gorman
2022-01-18 11:19 ` Peter Zijlstra
2022-01-28 7:40 ` [tip: sched/core] " tip-bot2 for Bharata B Rao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220118065828.GA451532@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=bharata@amd.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome