Re: [RFC][PATCH] PM: disable nonboot cpus before suspending devices

From: Andrew Morton
Date: Mon Feb 01 2010 - 10:57:53 EST


On Mon, 1 Feb 2010 16:30:04 +0100 "Rafael J. Wysocki" <rjw@xxxxxxx> wrote:

> On Monday 01 February 2010, Sebastian Ott wrote:
> > Hi Rafael,
> >
> > since you didn't like the idea of calling the driver callbacks with just
> > one cpu enabled, we gave your patch: "MM / PM: Force GFP_NOIO during
> > suspend/hibernation and resume" a try and i can confirm that this
> > fixes the issue on s390.
>
> Great, thanks for testing!
>
> > Will this go in 2.6.33/stable?
>
> That depends on Andrew, actually.
>
> Andrew, what do you think of the patch at:
> http://patchwork.kernel.org/patch/74740/mbox/ ?
>
> It helps people and I don't see any major drawbacks of it.
>

Seems sane. A couple of minor things:

- the names mm_force_noio_allocations() and mm_allow_io_allocations()
are a bit sucky. Asymmetrical.

- the functions don't nest: if someone calls
mm_force_noio_allocations() twice in succession then the kernel is
all mucked up. Why not:

gfp_t mm_set_gfp_mask(gfp_t mask)
{
gfp_t ret = gfp_allowed_mask;

gfp_allowed_mask = mask;
return ret;
}

which is of course racy :) Could add a local spinlock if really worried.

All your current callers can easily save the old value in a local.
--
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/