[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c2c67cc-d8a0-42cf-b9fe-c5e5c4f627c6@linux.microsoft.com>
Date: Mon, 17 Mar 2025 15:27:08 +0530
From: Naman Jain <namjain@...ux.microsoft.com>
To: Valentin Schneider <vschneid@...hat.com>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>
Cc: stable@...r.kernel.org, linux-kernel@...r.kernel.org,
Steve Wahl <steve.wahl@....com>,
Saurabh Singh Sengar <ssengar@...ux.microsoft.com>, srivatsa@...il.mit.edu,
K Prateek Nayak <kprateek.nayak@....com>,
Michael Kelley <mhklinux@...look.com>,
Shrikanth Hegde <sshegde@...ux.ibm.com>
Subject: Re: [PATCH v5] sched/topology: Enable topology_span_sane check only
for debug builds
On 3/11/2025 9:02 PM, Valentin Schneider wrote:
> On 10/03/25 10:55, Naman Jain wrote:
>> From: Saurabh Sengar <ssengar@...ux.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@...r.kernel.org
>> Fixes: ccf74128d66c ("sched/topology: Assert non-NUMA topology masks don't (partially) overlap")
>> Signed-off-by: Saurabh Sengar <ssengar@...ux.microsoft.com>
>> Co-developed-by: Naman Jain <namjain@...ux.microsoft.com>
>> Signed-off-by: Naman Jain <namjain@...ux.microsoft.com>
>> Tested-by: K Prateek Nayak <kprateek.nayak@....com>
>> ---
>> Changes since v4:
>> https://lore.kernel.org/all/20250306055354.52915-1-namjain@linux.microsoft.com/
>> - Rephrased print statement and moved it to sched_domain_debug.
>> (addressing Valentin's comments)
>> Changes since v3:
>> https://lore.kernel.org/all/20250203114738.3109-1-namjain@linux.microsoft.com/
>> - Minor typo correction in comment
>> - Added Tested-by tag from Prateek for x86
>> 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 | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
>> index c49aea8c1025..d7254c47af45 100644
>> --- a/kernel/sched/topology.c
>> +++ b/kernel/sched/topology.c
>> @@ -132,8 +132,11 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
>> {
>> int level = 0;
>>
>> - if (!sched_debug_verbose)
>> + if (!sched_debug_verbose) {
>> + pr_info_once("%s: Scheduler topology debugging disabled, add 'sched_verbose' to the cmdline to enable it\n",
>> + __func__);
>> return;
>> + }
>>
>
> Nit: I've been told not to break warnings over multiple lines so they can
> be grep'ed, but given this has the "sched_domain_debug:" prefix I think we
> could get away with the below.
>
> Regardless:
> Reviewed-by: Valentin Schneider <vschneid@...hat.com>
>
> ---
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index d7254c47af455..b4dc7c7d2c41c 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -133,7 +133,8 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
> int level = 0;
>
> if (!sched_debug_verbose) {
> - pr_info_once("%s: Scheduler topology debugging disabled, add 'sched_verbose' to the cmdline to enable it\n",
> + pr_info_once("%s: Scheduler topology debugging disabled, "
> + "add 'sched_verbose' to the cmdline to enable it\n",
> __func__);
> return;
> }
Hi Valentin,
Splitting the warning to different lines give checkpatch error with
--strict option. --fix option suggests we keep it like we have it
originally(single line). Please let me know if you feel we can change it
to something else or if you are fine with picking the change for next
iteration. Thanks again.
# ./scripts/checkpatch.pl --strict
v6-0001-sched-topology-Enable-topology_span_sane-check-on.patch
WARNING: quoted string split across lines
#40: FILE: kernel/sched/topology.c:137:
+ pr_info_once("%s: Scheduler topology debugging disabled, "
+ "add 'sched_verbose' to the cmdline to
enable it\n",
total: 0 errors, 1 warnings, 0 checks, 23 lines checked
Regards,
Naman
Powered by blists - more mailing lists