Re: [PATCH] profiling: remove prof_cpu_mask
From: Linus Torvalds
Date: Sat Jul 27 2024 - 12:54:27 EST
On Sat, 27 Jul 2024 at 04:00, Tetsuo Handa
<penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote:
>
> We could replace alloc_cpumask_var() with zalloc_cpumask_var() and
> call cpumask_copy() from create_proc_profile() on only UP kernels, for
> profile_online_cpu() calls cpumask_set_cpu() as needed via
> cpuhp_setup_state(CPUHP_AP_ONLINE_DYN) on SMP kernels. But this patch
> removes prof_cpu_mask because it seems unnecessary.
So I like this one a lot more, but it actually makes me wonder: could
we just remove the horrid per-cpu profile flip buffers entirely?
This code predates the whole "we have _real_ profiling", and dates
back to literally two decades ago.
It's there due to ancient NUMA concerns on old SGI Altix hardware in 2004:
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=ad02973d42f6b538c7ed76c7c0a5ae8560f65913
and I think it's past time to just take all this code out of its misery.
Nobody sane should use the old profile code for any real work any
more. I'd be more than happy to just remove all the magic code and see
if anybody even notices..
Linus