kmalloc during suspend, was Re: PCI PM: Restore standard configregisters of all devices early

From: Pavel Machek
Date: Tue Feb 10 2009 - 15:26:10 EST


On Tue 2009-02-03 12:03:46, Benjamin Herrenschmidt wrote:
>
> > > (*) There are reasons to think that kmalloc/gfp should both silently
> > > turn into GFP_NOIO always while the suspend process is started, but
> > > that's somewhat a different subject. Rafael, did we ever act on that ?
> > > It's an old discussion we had but I don't know if we actually
> > > implemented anything.
> >
> > We have the ->prepare(), ->complete() callbacks that, among other things,
> > can be used for allocating and freeing memory with GFP_KERNEL safely.
>
> First, that's assuming drivers will be smart enough to figure that out.
> They won't, believe me.

For big alocations, I see no other way. If someone wants 100MB for
firmmware image...

> Then, as I said, this doesn't work in practice because there is no way
> drivers and/or underlying subsystems will start "remembering" when they
> are within a prepare/complete pair, and suddenly do allocations
> differently. That's just going to break.

They could set a flag in ->prepare()... but yes, drivers will get that
wrong.

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/