Re: [PATCH v2] sched/topology: improve topology_span_sane speed

From: Steve Wahl
Date: Tue Dec 17 2024 - 13:38:21 EST


On Mon, Dec 16, 2024 at 04:38:57PM +0100, Valentin Schneider wrote:
>
> Hi,
>
> Sorry it took me this long to get to this.
>
...
> Per the previous comment, if you hinge the condition on @id itself,
> couldn't you "simplify" it as below?
>
> if (cpumask_test_cpu(id, id_seen)) {
> /* First CPU has already been seen, ensure identical spans */
> if (!cpumask_equal(tl->mask(id), tl_cpu_mask))
> return false;
> } else {
> /* First CPU hasn't been seen before, ensure it's a completely new span */
> if (cpumask_intersects(tl_cpu_mask, covered))
> return false;
>
> cpumask_or(covered, covered, tl_cpu_mask);
> cpumask_set_cpu(id, id_seen);
> }

After further evaluation, I wish to re-work this patch once again. I
ask that nobody consider merging this patch until I re-work it and
post v3.

Thanks,

--> Steve Wahl
--
Steve Wahl, Hewlett Packard Enterprise