Re: PCI PM: Restore standard config registers of all devices early

Linus Torvalds
2009-02-03T00:22:07Z

On Tue, 3 Feb 2009, Benjamin Herrenschmidt wrote:
>
> > * Memory allocations with GFP_KERNEL are made, which is even worse, because
> > we really shouldn't do that during suspend _at_ _all_, even during the regular
> > ->suspend() with interrupts on, because there's not guarantee that swap will
> > will be available at that time. So, for the sake of correctness, we should
> > get rid of the GFP_KERNEL from the ACPI code paths executed during
> > suspend-resume anyway.
>
> Well, as I said, this is a problem with more than just ACPI and again, I
> don't think the fix is to be done in ACPI itself. The buddy and slab
> should basically stick NOIO or ATOMIC to any allocation done after we
> started suspending the system.

We already do have magic code for things like PF_MEMALLOC (recursion), or
TIF_MEMDIE (oom) or "(rt_task(p)) && !in_interrupt()" (give RT tasks
higher priorities) in the page allocator.

Having a special case for NOT_RUNNING wouldn't be _pretty_, but it
certainly isn't totally unreasonable either.

Linus