[PATCH 2/2] x86/MCE: Add command line option to extend MCE Records pool

From: Naik, Avadhut
Date: Sat Feb 10 2024 - 16:15:44 EST


Hi,

On 2/10/2024 01:52, Borislav Petkov wrote:
> On February 9, 2024 9:51:11 PM GMT+01:00, Borislav Petkov <bp@xxxxxxxxx> wrote:
>> On Fri, Feb 09, 2024 at 02:35:12PM -0600, Naik, Avadhut wrote:
>>> IIUC, this is exactly what the first patch in this series is trying to
>>> accomplish. Please correct me if I understood wrong.
>>
>> Yes, you did.
>>
>> I don't mean to extend it - I mean to allocate it from the very
>> beginning to
>>
>> min(4*PAGE_SIZE, num_possible_cpus() * PAGE_SIZE);
>

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.

I was actually doing something similar initially (setting size of the
pool right after its creation) but then went with extending the pool
since I wasn't sure if heap allocations should be undertaken that
early during bootup.

> max() ofc.
>
Thanks! This does clear a one part of my confusion.

--
Thanks,
Avadhut Naik

>> There's a sane minimum and one page pro logical CPU should be fine on
>> pretty much every configuration...
>>
>> Thx.
>>
>
>