Re: [PATCH 1/6] Hibernation: Introduce new system state for the last phase of hibernation

From: Rafael J. Wysocki
Date: Fri Oct 03 2008 - 07:23:33 EST


On Friday, 3 of October 2008, Andrew Morton wrote:
> On Tue, 30 Sep 2008 00:10:37 +0200 "Rafael J. Wysocki" <rjw@xxxxxxx> wrote:
>
> > Hibernation: Introduce new system state for the last phase of hibernation
> >
> > Replace unused SYSTEM_SUSPEND_DISK with a new system_state value
> > SYSTEM_HIBERNATE_ENTER that can be used by device drivers to check if
> > the system is in the last phase of hibernation.
>
> Violent objections.
>
> We just don't know what this change will do. It potentially affects
> every code site in the kernel which looks at system_state.

Do you mean anyone checking 'system_state != SOMETHING' ? Oh well.

> We've had problems in the past with this thing and the more complex we make it,
> the worse any future problems will be. It's Just Bad.
>
> Can we just create a new global?
>
> extern bool system_entering_hibernation_or_whatever;

Yes, we can, but what about:

extern bool system_entering_hibernation(void);

that will become a static inline in case of !CONFIG_HIBERNATION,
and using a static variable?
--
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/