public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Naman Jain <namjain@linux.microsoft.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	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>,
	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: Thu, 6 Feb 2025 16:25:18 +0530	[thread overview]
Message-ID: <7f615780-3ccc-41e4-afe5-471df24e529c@linux.microsoft.com> (raw)
In-Reply-To: <f3f850a5-500f-4819-9884-c36e65d498cb@amd.com>



On 2/6/2025 3:49 PM, K Prateek Nayak wrote:
> Hello Naman,
> 
> On 2/6/2025 3:17 PM, Naman Jain wrote:
>> [..snip..]
>>>
>>> This is why I think that the topology_span_sane() check is redundant
>>> when the x86 bits have already ensured masks cannot overlap in all
>>> cases except for potentially in the (*) case.
>>>
>>> So circling back to my original question around "SDTL_ARCH_VERIFIED",
>>> would folks be okay to an early bailout from topology_span_sane() on:
>>>
>>>      if (!sched_debug() && (tl->flags & SDTL_ARCH_VERIFIED))
>>>          return;
>>>
>>> and more importantly, do folks care enough about topology_span_sane()
>>> to have it run on other architectures and not just have it guarded
>>> behind just "sched_debug()" which starts off as false by default?
>>>
>>> (Sorry for the long answer explaining my thought process.)
>>>
>>
>>
>> Thanks for sharing your valuable insights.
>> I am sorry, I could not find SDTL_ARCH_VERIFIED in linux-next tip. Am I
>> missing something?
> 
> It does not exits yet. I was proposing on defining this new flag
> "SDTL_ARCH_VERIFIED" which a particular arch can set if the topology
> parsing code has taken care of making sure that the cpumasks cannot
> overlap. The original motivation for topology_span_sane() discussed in
> [1] came from an ARM processor where the functions that returns the
> cpumask is not based on ID checks and can possibly allow overlapping
> masks.
> 
> With the exception of AMD Fam 0x15 processors which populates cu_id
> (and that too it is theoretical case), I believe all x86 processors can
> set this new flag "SDTL_ARCH_VERIFIED" and can safely skip the
> topology_span_sane() since it checks for a condition that cannot
> possibly be false as result of how these masks are built on x86.
> 
> [1] https://lore.kernel.org/lkml/ 
> f6bf04e8-3007-4a44-86d8-2cc671c85247@amd.com/

I think the check for sched_debug() should suffice here, without making
it more complicated. This way, we give the control to the user to have
it or not. I'll wait for a few more days to get any additional feedback
and post v4 with your initial review comments addressed.

Regards,
Naman

  reply	other threads:[~2025-02-06 10:55 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
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 [this message]
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=7f615780-3ccc-41e4-afe5-471df24e529c@linux.microsoft.com \
    --to=namjain@linux.microsoft.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.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