mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Saurabh Sengar <ssengar@linux.microsoft.com>, <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>,
	<vschneid@redhat.com>, <linux-kernel@vger.kernel.org>,
	Steve Wahl <steve.wahl@hpe.com>
Cc: <stable@vger.kernel.org>, <ssengar@microsoft.com>,
	<srivatsa@csail.mit.edu>
Subject: Re: [PATCH v2] sched/topology: Enable topology_span_sane check only for debug builds
Date: Tue, 19 Nov 2024 11:54:57 +0530	[thread overview]
Message-ID: <1e4c0bda-380e-5aba-984f-2a48debd7562@amd.com> (raw)
In-Reply-To: <1731922777-7121-1-git-send-email-ssengar@linux.microsoft.com>

(+ Steve)

Hello Saurabh,
On 11/18/2024 3:09 PM, Saurabh Sengar wrote:
> 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.

Steve too was optimizing this path. I believe his latest version can be
found at:
https://lore.kernel.org/lkml/20241031200431.182443-1-steve.wahl@hpe.com/

Does that approach help improving bootup time for you? Valentine
suggested the same approach as yours on a previous version of Steve's
optimization but Steve believed returning true can possibly have other
implication in the sched-domain building path. The thread can be found
at:
https://lore.kernel.org/lkml/Zw_k_WFeYFli87ck@swahl-home.5wahls.com/

> 
> 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 wants 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>
> ---
> [V2]
> 	- Use kernel cmdline param instead of compile time flag.
> 
>   kernel/sched/topology.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 9748a4c8d668..4ca63bff321d 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -2363,6 +2363,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 */
> +	if (!sched_debug_verbose) {

nit.

I think the convention in topology.c is to call "sched_debug()" and not
check "sched_debug_verbose" directly.

> +		pr_info_once("%s: Skipping topology span sanity check. Use `sched_verbose` boot parameter to enable it.\n",
> +			     __func__);
> +		return true;
> +	}
> +
>   	/* NUMA levels are allowed to overlap */
>   	if (tl->flags & SDTL_OVERLAP)
>   		return true;


-- 
Thanks and Regards,
Prateek

  reply	other threads:[~2024-11-19  6:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18  9:39 Saurabh Sengar
2024-11-19  6:24 ` K Prateek Nayak [this message]
2024-11-19 17:33   ` Steve Wahl
2024-12-13  6:45   ` Saurabh Singh Sengar

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=1e4c0bda-380e-5aba-984f-2a48debd7562@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=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srivatsa@csail.mit.edu \
    --cc=ssengar@linux.microsoft.com \
    --cc=ssengar@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

all inboxes | Powered by JetHome®