2022-09-09 09:31:28

by Miaohe Lin

[permalink] [raw]
Subject: [PATCH 11/16] mm/page_alloc: make boot_nodestats static

It's only used in mm/page_alloc.c now. Make it static.

Signed-off-by: Miaohe Lin <[email protected]>
---
mm/internal.h | 2 --
mm/page_alloc.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/internal.h b/mm/internal.h
index 2424fcde6538..43a441d35baf 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -864,8 +864,6 @@ int migrate_device_coherent_page(struct page *page);
*/
struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);

-DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
-
extern bool mirrored_kernelcore;

static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3417232afa45..7a8a6bb08a15 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6571,7 +6571,7 @@ static void per_cpu_pages_init(struct per_cpu_pages *pcp, struct per_cpu_zonesta
#define BOOT_PAGESET_BATCH 1
static DEFINE_PER_CPU(struct per_cpu_pages, boot_pageset);
static DEFINE_PER_CPU(struct per_cpu_zonestat, boot_zonestats);
-DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
+static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);

static void __build_all_zonelists(void *data)
{
--
2.23.0


2022-09-09 12:00:23

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH 11/16] mm/page_alloc: make boot_nodestats static

On 09.09.22 11:24, Miaohe Lin wrote:
> It's only used in mm/page_alloc.c now. Make it static.
>
> Signed-off-by: Miaohe Lin <[email protected]>
> ---
> mm/internal.h | 2 --
> mm/page_alloc.c | 2 +-
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 2424fcde6538..43a441d35baf 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -864,8 +864,6 @@ int migrate_device_coherent_page(struct page *page);
> */
> struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);
>
> -DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
> -
> extern bool mirrored_kernelcore;
>
> static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma)
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3417232afa45..7a8a6bb08a15 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6571,7 +6571,7 @@ static void per_cpu_pages_init(struct per_cpu_pages *pcp, struct per_cpu_zonesta
> #define BOOT_PAGESET_BATCH 1
> static DEFINE_PER_CPU(struct per_cpu_pages, boot_pageset);
> static DEFINE_PER_CPU(struct per_cpu_zonestat, boot_zonestats);
> -DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
> +static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
>
> static void __build_all_zonelists(void *data)
> {

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb

2022-09-13 09:48:11

by Anshuman Khandual

[permalink] [raw]
Subject: Re: [PATCH 11/16] mm/page_alloc: make boot_nodestats static



On 9/9/22 14:54, Miaohe Lin wrote:
> It's only used in mm/page_alloc.c now. Make it static.
>
> Signed-off-by: Miaohe Lin <[email protected]>

Reviewed-by: Anshuman Khandual <[email protected]>

> ---
> mm/internal.h | 2 --
> mm/page_alloc.c | 2 +-
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 2424fcde6538..43a441d35baf 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -864,8 +864,6 @@ int migrate_device_coherent_page(struct page *page);
> */
> struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);
>
> -DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
> -
> extern bool mirrored_kernelcore;
>
> static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma)
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3417232afa45..7a8a6bb08a15 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6571,7 +6571,7 @@ static void per_cpu_pages_init(struct per_cpu_pages *pcp, struct per_cpu_zonesta
> #define BOOT_PAGESET_BATCH 1
> static DEFINE_PER_CPU(struct per_cpu_pages, boot_pageset);
> static DEFINE_PER_CPU(struct per_cpu_zonestat, boot_zonestats);
> -DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
> +static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
>
> static void __build_all_zonelists(void *data)
> {

2022-09-15 08:12:04

by Oscar Salvador

[permalink] [raw]
Subject: Re: [PATCH 11/16] mm/page_alloc: make boot_nodestats static

On Fri, Sep 09, 2022 at 05:24:46PM +0800, Miaohe Lin wrote:
> It's only used in mm/page_alloc.c now. Make it static.
>
> Signed-off-by: Miaohe Lin <[email protected]>

Reviewed-by: Oscar Salvador <[email protected]>

> ---
> mm/internal.h | 2 --
> mm/page_alloc.c | 2 +-
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 2424fcde6538..43a441d35baf 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -864,8 +864,6 @@ int migrate_device_coherent_page(struct page *page);
> */
> struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);
>
> -DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
> -
> extern bool mirrored_kernelcore;
>
> static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma)
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3417232afa45..7a8a6bb08a15 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6571,7 +6571,7 @@ static void per_cpu_pages_init(struct per_cpu_pages *pcp, struct per_cpu_zonesta
> #define BOOT_PAGESET_BATCH 1
> static DEFINE_PER_CPU(struct per_cpu_pages, boot_pageset);
> static DEFINE_PER_CPU(struct per_cpu_zonestat, boot_zonestats);
> -DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
> +static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
>
> static void __build_all_zonelists(void *data)
> {
> --
> 2.23.0
>

--
Oscar Salvador
SUSE Labs