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:   Wed, 11 Aug 2021 17:14:02 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        linux-kernel@...r.kernel.org
Cc:     linux-mm@...ck.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v14 061/138] mm/migrate: Add folio_migrate_flags()

On 7/15/21 5:35 AM, Matthew Wilcox (Oracle) wrote:
> Turn migrate_page_states() into a wrapper around folio_migrate_flags().
> Also convert two functions only called from folio_migrate_flags() to
> be folio-based.  ksm_migrate_page() becomes folio_migrate_ksm() and
> copy_page_owner() becomes folio_copy_owner().  folio_migrate_flags()
> alone shrinks by two thirds -- 1967 bytes down to 642 bytes.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>

After fixing the bug below,
Acked-by: Vlastimil Babka <vbabka@...e.cz>


> --- a/include/linux/migrate.h
> +++ b/include/linux/migrate.h

...

> @@ -36,10 +36,10 @@ static inline void split_page_owner(struct page *page, unsigned int nr)
>  	if (static_branch_unlikely(&page_owner_inited))
>  		__split_page_owner(page, nr);
>  }
> -static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
> +static inline void folio_copy_owner(struct folio *newfolio, struct folio *old)

This changed order so that new is first.

...

> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -538,82 +538,80 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
>  }
>  
>  /*
> - * Copy the page to its new location
> + * Copy the flags and some other ancillary information
>   */
> -void migrate_page_states(struct page *newpage, struct page *page)
> +void folio_migrate_flags(struct folio *newfolio, struct folio *folio)
>  {

...

> -	copy_page_owner(page, newpage);
> +	folio_copy_owner(folio, newfolio);

This passes old first.

>  
> -	if (!PageHuge(page))
> +	if (!folio_test_hugetlb(folio))
>  		mem_cgroup_migrate(folio, newfolio);
>  }
> -EXPORT_SYMBOL(migrate_page_states);
> +EXPORT_SYMBOL(folio_migrate_flags);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ