RE: [PATCH v3 1/2] cacheinfo: Add function to get cacheinfo for a given (cpu, cachelevel)

From: Luck, Tony
Date: Sat Jun 08 2024 - 09:27:44 EST


> And yeah, this is an abomination.
>
>> How much do you *REALLY* want that lockdep_assert_cpus_held() to be in <linux/cacheinfo.h>
>
> If we had an easy fix sure but this really is a nightmare after trying
> it a bit here too.

I tried something too. I moved the cpu hotplug lock bits out of <linux/cpu.h>
into their own file <linux/cpuhplock.h>. Made cpu.h include this new file to
keep things the same for anything that includes cpu.h.

In the change to cacheinfo.h I just include the new cpuhplock.h as all
it needs is the lockdep_assert_cpus_held() declaration.

I haven't heard back from lkp yet ... but it may be promising. Code
is the top three commits in:

git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git get_cpu_cacheinfo_level


Does this look like an OK direction?

Any better name for the new header?

While I'm moving those declarations, should I zap the "extern " from the
function ones to match current fashion for this (checkpatch barfs all over
them)?

-Tony