public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Naman Jain <namjain@linux.microsoft.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>
Cc: <stable@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Steve Wahl <steve.wahl@hpe.com>,
	Saurabh Singh Sengar <ssengar@linux.microsoft.com>,
	<srivatsa@csail.mit.edu>, Michael Kelley <mhklinux@outlook.com>
Subject: Re: [PATCH v3] sched/topology: Enable topology_span_sane check only for debug builds
Date: Wed, 5 Feb 2025 12:50:40 +0530	[thread overview]
Message-ID: <bf469858-dedf-490a-abf2-b066aee6077e@amd.com> (raw)
In-Reply-To: <20250203114738.3109-1-namjain@linux.microsoft.com>

Hello Naman,

On 2/3/2025 5:17 PM, Naman Jain wrote:
> From: Saurabh Sengar <ssengar@linux.microsoft.com>
> 
> On a x86 system under test with 1780 CPUs, topology_span_sane() takes
> around 8 seconds cumulatively for all the iterations. It is an expensive
> operation which does the sanity of non-NUMA topology masks.
> 
> CPU topology is not something which changes very frequently hence make
> this check optional for the systems where the topology is trusted and
> need faster bootup.
> 
> Restrict this to sched_verbose kernel cmdline option so that this penalty
> can be avoided for the systems who want to avoid it.
> 
> Cc: stable@vger.kernel.org
> Fixes: ccf74128d66c ("sched/topology: Assert non-NUMA topology masks don't (partially) overlap")
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> Co-developed-by: Naman Jain <namjain@linux.microsoft.com>
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> ---
> 
> Changes since v2:
> https://lore.kernel.org/all/1731922777-7121-1-git-send-email-ssengar@linux.microsoft.com/
> 	- Use sched_debug() instead of using sched_debug_verbose
> 	  variable directly (addressing Prateek's comment)
> 
> Changes since v1:
> https://lore.kernel.org/all/1729619853-2597-1-git-send-email-ssengar@linux.microsoft.com/
> 	- Use kernel cmdline param instead of compile time flag.
> 
> Adding a link to the other patch which is under review.
> https://lore.kernel.org/lkml/20241031200431.182443-1-steve.wahl@hpe.com/
> Above patch tries to optimize the topology sanity check, whereas this
> patch makes it optional. We believe both patches can coexist, as even
> with optimization, there will still be some performance overhead for
> this check. > ---
>   kernel/sched/topology.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index c49aea8c1025..b030c1a2121f 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -2359,6 +2359,13 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl,
>   {
>   	int i = cpu + 1;
>   
> +	/* Skip the topology sanity check for non-debug, as it is a time-consuming operatin */

s/operatin/operation/

> +	if (!sched_debug()) {
> +		pr_info_once("%s: Skipping topology span sanity check. Use `sched_verbose` boot parameter to enable it.\n",

This could be broken down as follows:

		pr_info_once("%s: Skipping topology span sanity check."
			     " Use `sched_verbose` boot parameter to enable it.\n",
			     __func__);

Running:

     grep -r -A 5 "pr_info(.*[^;,]$" kernel/

gives similar usage across kernel/*. Apart from those nits, feel
free to add:

Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> # x86

if the future version does not change much.

-- 
Thanks and Regards,
Prateek

> +			     __func__);
> +		return true;
> +	}
> +
>   	/* NUMA levels are allowed to overlap */
>   	if (tl->flags & SDTL_OVERLAP)
>   		return true;
> 
> base-commit: 00f3246adeeacbda0bd0b303604e46eb59c32e6e



  reply	other threads:[~2025-02-05  7:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 11:47 [PATCH v3] sched/topology: Enable topology_span_sane check only for debug builds Naman Jain
2025-02-05  7:20 ` K Prateek Nayak [this message]
2025-02-05  7:23   ` Naman Jain
2025-02-10  9:53     ` Naman Jain
2025-02-05  9:48 ` K Prateek Nayak
2025-02-05  9:55   ` Peter Zijlstra
2025-02-05 10:13     ` K Prateek Nayak
2025-02-05 10:16       ` Peter Zijlstra
2025-02-06  9:10         ` K Prateek Nayak
2025-02-06  9:47           ` Naman Jain
2025-02-06 10:19             ` K Prateek Nayak
2025-02-06 10:55               ` Naman Jain
2025-02-06 15:24           ` Valentin Schneider
2025-02-06 15:30             ` Steve Wahl
2025-02-06 17:18             ` Naman Jain
2025-02-07  2:44             ` K Prateek Nayak
2025-02-11  5:52   ` Shrikanth Hegde
2025-02-11  7:06     ` Naman Jain
2025-02-11 10:56     ` K Prateek Nayak

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=bf469858-dedf-490a-abf2-b066aee6077e@amd.com \
    --to=kprateek.nayak@amd.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=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=namjain@linux.microsoft.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srivatsa@csail.mit.edu \
    --cc=ssengar@linux.microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=steve.wahl@hpe.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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