[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNO-HpLE43+jQeBC=YxMHDkaHjKrrBg1sUeCMQKPv3kE_w@mail.gmail.com>
Date: Wed, 2 Mar 2022 19:15:32 +0100
From: Marco Elver <elver@...gle.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: David Rientjes <rientjes@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Pekka Enberg <penberg@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
patches@...ts.linux.dev, linux-kernel@...r.kernel.org,
Oliver Glitta <glittao@...il.com>,
Faiyaz Mohammed <faiyazm@...eaurora.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
Hyeonggon Yoo <42.hyeyoo@...il.com>,
Imran Khan <imran.f.khan@...cle.com>
Subject: Re: [PATCH v2 1/6] lib/stackdepot: allow requesting early
initialization dynamically
On Wed, 2 Mar 2022 at 19:02, Vlastimil Babka <vbabka@...e.cz> wrote:
[...]
> > Similarly, for stack_depot_want_early_init, where instead you could
> > simply provide stack_depot_want_early_init() as a function, which simply
> > sets a boolean __stack_depot_want_early_init. If !STACKDEPOT, it'll also
> > just be a no-op function.
>
> Yeah, makes sense. I guess I have patch 3/6 wrong now anyway as with
> !STACKDEPOT it should fail linking due to missing stack_depot_want_early_init...
Right. It probably still worked because the compiler likely optimizes
out the dead call, but you never know...
> >> +bool stack_depot_want_early_init = false;
> >> +
> >
> > This can be __initdata, right?
>
> I initially thought so too, but in include/linux/init.h found
> * Don't forget to initialize data not at file scope, i.e. within a function,
> * as gcc otherwise puts the data into the bss section and not into the init
> * section.
> But maybe that's just outdated as everyone seems to init them at file scope.
I think that comment is just about static variables inside functions?
Here it's at file scope, so that caveat shouldn't apply. As an aside,
you could omit '= false' because it'd zero-init by default.
Thanks,
-- Marco
Powered by blists - more mailing lists