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, 19 Sep 2022 15:24:19 -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, vbabka@...e.cz, william.kucharski@...cle.com,
        dhowells@...hat.com, peterx@...hat.com, arnd@...db.de,
        ccross@...gle.com, hughd@...gle.com, ebiederm@...ssion.com
Subject: Re: [PATCH v3 3/6] mm/hugetlb: add hugetlb_folio_subpool() helper

On 09/08/22 12:37, Sidhartha Kumar wrote:
> Allows hugetlbfs_migrate_folio to check subpool information by passing
> in a folio.
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
> (cherry picked from commit cd9e187858b45b890097cfcd0b2eb4bbbb9a59ae)

??? I think this must have been included by mistake.

> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
> ---
>  fs/hugetlbfs/inode.c    | 4 ++--
>  include/linux/hugetlb.h | 7 ++++++-
>  2 files changed, 8 insertions(+), 3 deletions(-)

I think this and the following patch are simple enough to combine.  They
both are dealing with accessing/setting hugetlb subpool info.  They already
have the same 'Subject:'. :)

With these fixups,
Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>
-- 
Mike Kravetz

> 
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index 52d9b390389b..c2e9c0cdbd81 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -1151,9 +1151,9 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping,
>  	if (rc != MIGRATEPAGE_SUCCESS)
>  		return rc;
>  
> -	if (hugetlb_page_subpool(&src->page)) {
> +	if (hugetlb_folio_subpool(src)) {
>  		hugetlb_set_page_subpool(&dst->page,
> -					hugetlb_page_subpool(&src->page));
> +					hugetlb_folio_subpool(src));
>  		hugetlb_set_page_subpool(&src->page, NULL);
>  	}
>  
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 0952ea50251d..1e7c4007386e 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -744,12 +744,17 @@ extern unsigned int default_hstate_idx;
>  
>  #define default_hstate (hstates[default_hstate_idx])
>  
> +static inline struct hugepage_subpool *hugetlb_folio_subpool(struct folio *folio)
> +{
> +	return (void *)folio_get_private_1(folio);
> +}
> +
>  /*
>   * hugetlb page subpool pointer located in hpage[1].private
>   */
>  static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage)
>  {
> -	return (void *)page_private(hpage + SUBPAGE_INDEX_SUBPOOL);
> +	return hugetlb_folio_subpool(page_folio(hpage));
>  }
>  
>  static inline void hugetlb_set_page_subpool(struct page *hpage,
> -- 
> 2.31.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ