Re: [PATCH] x86/mce: Dynamically size space for machine check records

From: Tony Luck
Date: Thu Feb 29 2024 - 12:22:20 EST


On Thu, Feb 29, 2024 at 10:49:18AM -0500, Yazen Ghannam wrote:
> On 2/28/2024 8:56 PM, Sohil Mehta wrote:
> > > + order = ilog2(sizeof(struct mce_evt_llist)) + 1;
> >
> > I didn't exactly understand why a +1 is needed here. Do you have a
> > pointer to somewhere to help understand this?
> >
> > Also, I think, a comment on top might be useful since this isn't obvious.
> >
>
> Would order_base_2() work here? It automatically rounds up to the next power.

Yes! That's exactly what is needed here. Thanks!

-Tony