[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <774e7ca5-154d-4ca4-bc4c-2f945c20b938@amd.com>
Date: Sun, 11 Feb 2024 20:54:29 -0600
From: "Naik, Avadhut" <avadnaik@....com>
To: Borislav Petkov <bp@...en8.de>
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
Hi,
On 2/11/2024 05:14, Borislav Petkov wrote:
> 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.
>
Okay. Will make changes to allocate memory and set size of the pool
when it is created. Also, will remove the command line parameter and
resubmit.
> 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.
Thanks for this explanation!
>
--
Thanks,
Avadhut Naik
Powered by blists - more mailing lists