[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zw7tdG1J9-SoUdT3@swahl-home.5wahls.com>
Date: Tue, 15 Oct 2024 17:32:20 -0500
From: Steve Wahl <steve.wahl@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: K Prateek Nayak <kprateek.nayak@....com>, Steve Wahl <steve.wahl@....com>,
Russ Anderson <rja@....com>, Dimitri Sivanich <sivanich@....com>,
Ingo Molnar <mingo@...hat.com>, 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>, Valentin Schneider <vschneid@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/topology: improve topology_span_sane speed
On Tue, Oct 15, 2024 at 01:05:44PM +0200, Peter Zijlstra wrote:
> On Tue, Oct 15, 2024 at 03:50:49PM +0530, K Prateek Nayak wrote:
>
> > > + masks = kmalloc_array(num_possible_cpus(), sizeof(struct cpumask *), GFP_KERNEL);
> > > + if (!masks)
> > > + return ret;
> >
> > That looks like a very large array that seems unnecessary. Instead, is
> > it possible to use "tl->mask(id)" down blow to check for equality? (I'll
> > elaborate more below)
>
> drive-by comments, haven't got time atm to read this, but
> num_possible_cpus() is wrong, this should be nr_cpu_ids.
>
> The CPU mask must not be assumed dense.
You're absolutly right, not sure how I did this, but Prateek's
suggestion will remove the array and needing to size it, so this
problem will be removed in the next iteration.
--> Steve
--
Steve Wahl, Hewlett Packard Enterprise
Powered by blists - more mailing lists