[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210105072851.GO13207@dhcp22.suse.cz>
Date: Tue, 5 Jan 2021 08:28:51 +0100
From: Michal Hocko <mhocko@...e.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Matthew Wilcox <willy@...radead.org>, Hui Su <sh_def@....com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/page_alloc: remove the static for local variable
node_order
On Mon 04-01-21 15:23:57, Andrew Morton wrote:
> On Wed, 30 Dec 2020 12:42:33 +0000 Matthew Wilcox <willy@...radead.org> wrote:
>
> > On Wed, Dec 30, 2020 at 07:40:14PM +0800, Hui Su wrote:
> > > local variable node_order do not need the static here.
> >
> > It bloody well does. It can be up to 2^10 entries on x86 (and larger
> > on others) That's 4kB which you've now moved onto the stack.
>
> That being said, could we kmalloc the scratch area in
> __build_all_zonelists()? And maybe remove that static spinlock?
I am not sure we can (e.g. early init code) but even if we could, what
would be an advantage. This code is called very seldom with a very
shallow stacks so using the stack allocation sounds like the easiest
thing to do.
> (what blocks node and cpu hotplug in there??)
Memory hotplug is excluded by the caller when it matters (e.g. no
locking for the early init).
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists