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]
Message-ID: <20210116042416.GA2260413@casper.infradead.org>
Date:   Sat, 16 Jan 2021 04:24:16 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Mike Kravetz <mike.kravetz@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Michal Hocko <mhocko@...nel.org>,
        Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
        Muchun Song <songmuchun@...edance.com>,
        David Hildenbrand <david@...hat.com>,
        Oscar Salvador <osalvador@...e.de>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/5] hugetlb: convert page_huge_active() to HP_Migratable
 flag

On Fri, Jan 15, 2021 at 04:31:02PM -0800, Mike Kravetz wrote:
> +++ b/fs/hugetlbfs/inode.c
> @@ -735,7 +735,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
>  
>  		mutex_unlock(&hugetlb_fault_mutex_table[hash]);
>  
> -		set_page_huge_active(page);
> +		hugetlb_set_page_flag(page, HP_Migratable);

I had understood the request to be more like ...

		SetHPageMigratable(page);

> +++ b/include/linux/hugetlb.h
> @@ -480,9 +480,13 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
>   * HP_Restore_Reserve - Set when a hugetlb page consumes a reservation at
>   *	allocation time.  Cleared when page is fully instantiated.  Free
>   *	routine checks flag to restore a reservation on error paths.
> + * HP_Migratable - Set after a newly allocated page is added to the page
> + *	cache and/or page tables.  Indicates the page is a candidate for
> + *	migration.
>   */
>  enum hugetlb_page_flags {
>  	HP_Restore_Reserve = 0,
> +	HP_Migratable,
>  };

and name these HPG_restore_reserve and HPG_migratable

and generate the calls to hugetlb_set_page_flag etc from macros, eg:

#define TESTHPAGEFLAG(uname, lname)					\
static __always_inline bool HPage##uname(struct page *page)		\
{ return test_bit(HPG_##lname, &page->private); }
...
#define HPAGEFLAG(uname, lname)						\
	TESTHPAGEFLAG(uname, lname)					\
	SETHPAGEFLAG(uname, lname)					\
	CLEARHPAGEFLAG(uname, lname)

HPAGEFLAG(RestoreReserve, restore_reserve)
HPAGEFLAG(Migratable, migratable)

just to mirror page-flags.h more closely.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ