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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 Oct 2022 09:13:20 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, songmuchun@...edance.com,
        willy@...radead.org, almasrymina@...gle.com, linmiaohe@...wei.com,
        minhquangbui99@...il.com, aneesh.kumar@...ux.ibm.com
Subject: Re: [PATCH 2/9] mm/hugetlb_cgroup: convert
 hugetlb_cgroup_from_page() to folios

On 10/13/22 20:12, Sidhartha Kumar wrote:
> Introduce folios in __remove_hugetlb_page() by converting
> hugetlb_cgroup_from_page() to use folios.
> 
> Also gets rid of unsed hugetlb_cgroup_from_page_resv() function.
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
> ---
>  include/linux/hugetlb_cgroup.h | 39 +++++++++++++++++-----------------
>  mm/hugetlb.c                   |  5 +++--
>  mm/hugetlb_cgroup.c            | 13 +++++++-----
>  3 files changed, 31 insertions(+), 26 deletions(-)

Changes look fine.  However ...

> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 4133ffbbeb50..bcb9bfce32ee 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1434,9 +1434,10 @@ static void __remove_hugetlb_page(struct hstate *h, struct page *page,
>  							bool demote)
>  {
>  	int nid = page_to_nid(page);
> +	struct folio *folio = page_folio(page);
>  
> -	VM_BUG_ON_PAGE(hugetlb_cgroup_from_page(page), page);
> -	VM_BUG_ON_PAGE(hugetlb_cgroup_from_page_rsvd(page), page);
> +	VM_BUG_ON_FOLIO(hugetlb_cgroup_from_folio(folio), folio);
> +	VM_BUG_ON_FOLIO(hugetlb_cgroup_from_folio_rsvd(folio), folio);
>  
>  	lockdep_assert_held(&hugetlb_lock);
>  	if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())

... there is also this a little further in the routine.  

	if (HPageFreed(page)) {

Should probably change this to?

	if (folio_test_hugetlb_freed(folio)) {

Or, is that part of a planned subsequent change?
-- 
Mike Kravetz

Powered by blists - more mailing lists