[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240211111455.GAZcisL09LeFPWa2EI@fat_crate.local>
Date: Sun, 11 Feb 2024 12:14:55 +0100
From: Borislav Petkov <bp@...en8.de>
To: "Naik, Avadhut" <avadnaik@....com>
Cc: Sohil Mehta <sohil.mehta@...el.com>, x86@...nel.org,
linux-edac@...r.kernel.org, tony.luck@...el.com,
linux-kernel@...r.kernel.org, yazen.ghannam@....com,
Avadhut Naik <avadhut.naik@....com>
Subject: Re: [PATCH 2/2] x86/MCE: Add command line option to extend MCE
Records pool
On Sat, Feb 10, 2024 at 03:15:26PM -0600, Naik, Avadhut wrote:
> IIUC, you wouldn't want to extend the pool through late_initcall().
> Instead, you would want for memory to be allocated (on the heap) and
> size of the pool to be set at the very beginning i.e. when the pool
> is created (~2 seconds, according to dmesg timestamps).
>
> Please correct me if I have understood wrong.
Nah, you got it right. I went, looked and realized that we have to do
this early dance because we have no allocator yet. And we can't move
this gen_pool allocation to later, when we *do* have an allocator
because MCA is up and logging already.
But your extending approach doesn't fly in all cases either:
gen_pool_add->gen_pool_add_virt->gen_pool_add_owner
it grabs the pool->lock spinlock and adds to &pool->chunks while, at the
exact same time, gen_pool_alloc(), in *NMI* context iterates over that
same &pool->chunks in the case we're logging an MCE at exact that same
time when you're extending the buffer.
And Tony already said that in the thread you're quoting:
https://lore.kernel.org/linux-edac/SJ1PR11MB60832922E4D036138FF390FAFCD7A@SJ1PR11MB6083.namprd11.prod.outlook.com/
So no, that doesn't work either.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists