Re: [PATCH] x86/alternative: delay freeing of smp_locks section

From: Borislav Petkov

Date: Sat Mar 28 2026 - 16:00:12 EST


On Sat, Mar 28, 2026 at 03:39:15PM +0300, Mike Rapoport wrote:
> It's as old as CONFIG_DEFERRED_STRUCT_PAGE_INIT (v4.2) or even before that.
> If you think that fixing this leak is important enough to backport, it
> affects all mainlined stable releases.

Probably not all but perhaps the last two - 6.12 and 6.18...

> Yes, I added a WARN() in free_reserved_area() to lure such cases and
> prevent them in the future.

This warn is supposed to catch the leaks. I guess it is important enough to
add the warning so it is just as important to fix them leaks, right :-)

As to the fix itself, arch_initcall() is the magic time where deferred
initialization is complete, I presume?

> I'll wait a bit for more comments before rewriting changelog and reposting.

Yes please. You could also expand on why the arch initcall is the proper fix.
I guess deferred init completes with an earlier initcall. So yeah, it would be
good to have that written down explicitly too.

On and pls use those tags:

Tested-by: Bert Karwatzki <spasswolf@xxxxxx>
Reported-by: Bert Karwatzki <spasswolf@xxxxxx>
Link: https://lore.kernel.org/r/20260327140109.7561-1-spasswolf@xxxxxx

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette