Re: [patch 08/18] mm: Adjust system_state check

From: Steven Rostedt
Date: Mon May 15 2017 - 10:33:48 EST


On Mon, 15 May 2017 08:18:26 +0200
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:


> > --- a/drivers/base/node.c
> > +++ b/drivers/base/node.c
> > @@ -377,7 +377,7 @@ static int __ref get_nid_for_pfn(unsigne
> > if (!pfn_valid_within(pfn))
> > return -1;
> > #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
> > - if (system_state == SYSTEM_BOOTING)
> > + if (system_state < SYSTEM_RUNNING)
>
> Someone better comment the place where these are defined that they need
> to be in a specific order, I don't think they have been tested this way
> in the past...

Comments never hurt but it has been used before this patch set.

$ git grep SYSTEM_RUNNING v4.12-rc1 | grep -e '<' -e '>'
v4.12-rc1:arch/powerpc/kernel/smp.c: if (system_state < SYSTEM_RUNNING)
v4.12-rc1:arch/powerpc/platforms/powernv/eeh-powernv.c: if (system_state < SYSTEM_RUNNING)
v4.12-rc1:arch/powerpc/platforms/powernv/eeh-powernv.c: if (system_state < SYSTEM_RUNNING)
v4.12-rc1:drivers/cpuidle/cpuidle-powernv.c: if (unlikely(system_state < SYSTEM_RUNNING))
v4.12-rc1:drivers/xen/xenbus/xenbus_probe.c: if (system_state > SYSTEM_RUNNING) {

-- Steve