public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* Re: [PATCH v2 5/7] powerpc: Stop calling page_address() in free_pages()
       [not found] ` <20250826205617.1032945-6-vishal.moola@gmail.com>
@ 2025-09-01  3:47   ` Ritesh Harjani
  0 siblings, 0 replies; only message in thread
From: Ritesh Harjani @ 2025-09-01  3:47 UTC (permalink / raw)
  To: Vishal Moola (Oracle), linux-mm
  Cc: linux-kernel, Andrew Morton, Vishal Moola (Oracle),
	Madhavan Srinivasan, Michael Ellerman, linuxppc-dev


Hi Vishal,

"Vishal Moola (Oracle)" <vishal.moola@gmail•com> writes:

> free_pages() should be used when we only have a virtual address. We
> should call __free_pages() directly on our page instead.
>
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail•com>
> ---
>  arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Please also cc the respective subsystem mailing list if the changes span
in their area. In this case that would be linuxppc-dev@lists•ozlabs.org
( I did it this time )


Thanks for doing the cleanup. Yes, it makes no sense to do page_address()
here and then free_pages() doing virt_to_page() internally.. 

The change looks good to me. Please feel free to add:

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail•com>

>
> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
> index be523e5fe9c5..73977dbabcf2 100644
> --- a/arch/powerpc/mm/book3s64/radix_pgtable.c
> +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
> @@ -780,7 +780,7 @@ static void __meminit free_vmemmap_pages(struct page *page,
>  		while (nr_pages--)
>  			free_reserved_page(page++);
>  	} else
> -		free_pages((unsigned long)page_address(page), order);
> +		__free_pages(page, order);
>  }
>  
>  static void __meminit remove_pte_table(pte_t *pte_start, unsigned long addr,
> -- 
> 2.51.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-01  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250826205617.1032945-1-vishal.moola@gmail.com>
     [not found] ` <20250826205617.1032945-6-vishal.moola@gmail.com>
2025-09-01  3:47   ` [PATCH v2 5/7] powerpc: Stop calling page_address() in free_pages() Ritesh Harjani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox