diff mbox series

[v6,1/4] mm/page_alloc: remove unused fpi_flags in free_pages_prepare()

Message ID 20240216170432.1268753-2-zi.yan@sent.com (mailing list archive)
State New
Headers show
Series [v6,1/4] mm/page_alloc: remove unused fpi_flags in free_pages_prepare() | expand

Commit Message

Zi Yan Feb. 16, 2024, 5:04 p.m. UTC
From: Zi Yan <ziy@nvidia.com>

fpi_flags is only passed to should_skip_kasan_poison() but ignored
by the function. Remove the unused parameter.

Signed-off-by: Zi Yan <ziy@nvidia.com>
---
 mm/page_alloc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Vlastimil Babka Feb. 16, 2024, 5:19 p.m. UTC | #1
On 2/16/24 18:04, Zi Yan wrote:
> From: Zi Yan <ziy@nvidia.com>
> 
> fpi_flags is only passed to should_skip_kasan_poison() but ignored
> by the function. Remove the unused parameter.
> 
> Signed-off-by: Zi Yan <ziy@nvidia.com>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

Thanks.
David Hildenbrand Feb. 20, 2024, 8:48 a.m. UTC | #2
On 16.02.24 18:04, Zi Yan wrote:
> From: Zi Yan <ziy@nvidia.com>
> 
> fpi_flags is only passed to should_skip_kasan_poison() but ignored
> by the function. Remove the unused parameter.
> 
> Signed-off-by: Zi Yan <ziy@nvidia.com>
> ---
>   mm/page_alloc.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 7ae4b74c9e5c..70c1ed3addf3 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1061,7 +1061,7 @@ static int free_tail_page_prepare(struct page *head_page, struct page *page)
>    * on-demand allocation and then freed again before the deferred pages
>    * initialization is done, but this is not likely to happen.
>    */
> -static inline bool should_skip_kasan_poison(struct page *page, fpi_t fpi_flags)
> +static inline bool should_skip_kasan_poison(struct page *page)
>   {
>   	if (IS_ENABLED(CONFIG_KASAN_GENERIC))
>   		return deferred_pages_enabled();
> @@ -1081,10 +1081,10 @@ static void kernel_init_pages(struct page *page, int numpages)
>   }
>   
>   static __always_inline bool free_pages_prepare(struct page *page,
> -			unsigned int order, fpi_t fpi_flags)
> +			unsigned int order)
>   {
>   	int bad = 0;
> -	bool skip_kasan_poison = should_skip_kasan_poison(page, fpi_flags);
> +	bool skip_kasan_poison = should_skip_kasan_poison(page);
>   	bool init = want_init_on_free();
>   	bool compound = PageCompound(page);
>   
> @@ -1266,7 +1266,7 @@ static void __free_pages_ok(struct page *page, unsigned int order,
>   	unsigned long pfn = page_to_pfn(page);
>   	struct zone *zone = page_zone(page);
>   
> -	if (!free_pages_prepare(page, order, fpi_flags))
> +	if (!free_pages_prepare(page, order))
>   		return;
>   
>   	/*
> @@ -2379,7 +2379,7 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn,
>   {
>   	int migratetype;
>   
> -	if (!free_pages_prepare(page, order, FPI_NONE))
> +	if (!free_pages_prepare(page, order))
>   		return false;
>   
>   	migratetype = get_pfnblock_migratetype(page, pfn);

Likely due to

commit 0a54864f8dfb64b64c84c9db6ff70e0e93690a33
Author: Peter Collingbourne <pcc@google.com>
Date:   Thu Mar 9 20:29:14 2023 -0800

     kasan: remove PG_skip_kasan_poison flag

That removed the usage of fpi_flags in should_skip_kasan_poison.

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7ae4b74c9e5c..70c1ed3addf3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1061,7 +1061,7 @@  static int free_tail_page_prepare(struct page *head_page, struct page *page)
  * on-demand allocation and then freed again before the deferred pages
  * initialization is done, but this is not likely to happen.
  */
-static inline bool should_skip_kasan_poison(struct page *page, fpi_t fpi_flags)
+static inline bool should_skip_kasan_poison(struct page *page)
 {
 	if (IS_ENABLED(CONFIG_KASAN_GENERIC))
 		return deferred_pages_enabled();
@@ -1081,10 +1081,10 @@  static void kernel_init_pages(struct page *page, int numpages)
 }
 
 static __always_inline bool free_pages_prepare(struct page *page,
-			unsigned int order, fpi_t fpi_flags)
+			unsigned int order)
 {
 	int bad = 0;
-	bool skip_kasan_poison = should_skip_kasan_poison(page, fpi_flags);
+	bool skip_kasan_poison = should_skip_kasan_poison(page);
 	bool init = want_init_on_free();
 	bool compound = PageCompound(page);
 
@@ -1266,7 +1266,7 @@  static void __free_pages_ok(struct page *page, unsigned int order,
 	unsigned long pfn = page_to_pfn(page);
 	struct zone *zone = page_zone(page);
 
-	if (!free_pages_prepare(page, order, fpi_flags))
+	if (!free_pages_prepare(page, order))
 		return;
 
 	/*
@@ -2379,7 +2379,7 @@  static bool free_unref_page_prepare(struct page *page, unsigned long pfn,
 {
 	int migratetype;
 
-	if (!free_pages_prepare(page, order, FPI_NONE))
+	if (!free_pages_prepare(page, order))
 		return false;
 
 	migratetype = get_pfnblock_migratetype(page, pfn);