lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aBHasvr4d3liqX6e@localhost.localdomain>
Date: Wed, 30 Apr 2025 10:09:22 +0200
From: Oscar Salvador <osalvador@...e.de>
To: nifan.cxl@...il.com
Cc: muchun.song@...ux.dev, willy@...radead.org, mcgrof@...nel.org,
	a.manzanares@...sung.com, dave@...olabs.net,
	akpm@...ux-foundation.org, david@...hat.com, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, Fan Ni <fan.ni@...sung.com>
Subject: Re: [PATCH v3 4/4] mm/hugetlb: Convert use of struct page to folio
 in __unmap_hugepage_range()

On Mon, Apr 28, 2025 at 10:11:47AM -0700, nifan.cxl@...il.com wrote:
> From: Fan Ni <fan.ni@...sung.com>
> 
> In __unmap_hugepage_range(), the "page" pointer always points to the
> first page of a huge page, which guarantees there is a folio associating
> with it.  Convert the "page" pointer to use folio.
> 
> Signed-off-by: Fan Ni <fan.ni@...sung.com>
> ---
>  mm/hugetlb.c | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 6696206d556e..293c2afa724b 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -5815,12 +5815,12 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
>  	pte_t *ptep;
>  	pte_t pte;
>  	spinlock_t *ptl;
> -	struct page *page;
>  	struct hstate *h = hstate_vma(vma);
>  	unsigned long sz = huge_page_size(h);
>  	bool adjust_reservation = false;
>  	unsigned long last_addr_mask;
>  	bool force_flush = false;
> +	const bool folio_provided = !!folio;

This might be me just nitpicking but:

Why not rename folio to ref_folio o provided_folio and do

        struct folio *folio = ref_folio;

I think it is more natural than the boolean.

Also you need to update the comment that references the 'reference page' and the one
David mentioned.

Anyway,

Reviewed-by: Oscar Salvador <osalvador@...e.de>


-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ