RE: [PATCH] x86/hyperv: Suspend/resume the VP assist page for hibernation

From: Dexuan Cui
Date: Fri Apr 17 2020 - 18:45:05 EST


> From: Wei Liu <wei.liu@xxxxxxxxxx>
> Sent: Friday, April 17, 2020 2:08 AM
> > @@ -72,7 +72,8 @@ static int hv_cpu_init(unsigned int cpu)
> > struct page *pg;
> >
> > input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg);
> > - pg = alloc_page(GFP_KERNEL);
> > + /* hv_cpu_init() can be called with IRQs disabled from hv_resume() */
> > + pg = alloc_page(GFP_ATOMIC);
>
> IMHO it would be better to only tap into the reserve pool if so
> required, e.g.
>
> pg = alloc_page(irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
>
> Wei.

Ok, I'll follow the suggestion.

BTW, there are indeed some usages like this, but not a lot:
grep irqs_disabled drivers/acpi include/acpi drivers/trace -nr |grep GFP_ATOMIC | grep GFP_KERNEL

Thanks,
-- Dexuan