lkml.org 
[lkml]   [2023]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 07/12] x86/mtrr: allocate mtrr_value array dynamically
On 20.03.23 16:31, Dave Hansen wrote:
> On 3/20/23 06:49, Juergen Gross wrote:
>>>>
>>>> @@ -750,6 +750,7 @@ static int __init mtrr_init_finialize(void)
>>>>        * TBD: is there any system with such CPU which supports
>>>>        * suspend/resume? If no, we should remove the code.
>>>>        */
>>>> +    mtrr_value = kcalloc(num_var_ranges, sizeof(*mtrr_value),
>>>> GFP_KERNEL);
>>>
>>> Theoretically dynamic allocation can fail, although it should not
>>> happen as this
>>> happens during kernel boot and the size is small.  Maybe a WARN()?
>>
>> Fine with me.
>
> What *actually* happens if the system is running out of memory and this
> is the _first_ failure? Does a WARN_ON() here help someone debug what
> is going on?

Good question. Especially as we don't set __GFP_NOWARN here.


Juergen
[unhandled content-type:application/pgp-keys][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-03-27 01:09    [W:0.090 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site