[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4imXWDSoVet4a0CYtO3JxN__f1hq+LCKTnjjF+4HB+6Kw@mail.gmail.com>
Date: Fri, 27 Sep 2019 12:32:54 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Kaitao Cheng <pilgrimtao@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Sasha Levin <sashal@...nel.org>,
Michal Hocko <mhocko@...e.com>,
Oscar Salvador <osalvador@...e.de>,
Mel Gorman <mgorman@...hsingularity.net>,
Mike Rapoport <rppt@...ux.ibm.com>,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Pasha Tatashin <pavel.tatashin@...rosoft.com>,
Alexander Potapenko <glider@...gle.com>,
Linux MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Muchun Song <smuchun@...il.com>
Subject: Re: [PATCH] mm, page_alloc: drop pointless static qualifier in build_zonelists()
On Fri, Sep 27, 2019 at 9:14 AM Kaitao Cheng <pilgrimtao@...il.com> wrote:
>
> There is no need to make the 'node_order' variable static
> since new value always be assigned before use it.
>
> Signed-off-by: Kaitao Cheng <pilgrimtao@...il.com>
> Signed-off-by: Muchun Song <smuchun@...il.com>
> ---
> mm/page_alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3334a769eb91..c473c304d09f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5597,7 +5597,7 @@ static void build_thisnode_zonelists(pg_data_t *pgdat)
>
> static void build_zonelists(pg_data_t *pgdat)
> {
> - static int node_order[MAX_NUMNODES];
> + int node_order[MAX_NUMNODES];
This isn't pointless. This prevents 4KB stack allocation which might overflow.
Powered by blists - more mailing lists