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: <02de399f-1ecf-98d6-6a78-1301f9a97d5a@redhat.com>
Date:   Fri, 16 Apr 2021 10:36:01 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Oscar Salvador <osalvador@...e.de>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Mike Kravetz <mike.kravetz@...cle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Michal Hocko <mhocko@...nel.org>,
        Muchun Song <songmuchun@...edance.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH v9 6/7] mm: Make alloc_contig_range handle in-use hugetlb
 pages


> -int isolate_or_dissolve_huge_page(struct page *page)
> +int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list)
>   {
>   	struct hstate *h;
>   	struct page *head;
> +	int ret = -EBUSY;
>   
>   	/*
>   	 * The page might have been dissolved from under our feet, so make sure
> @@ -2373,13 +2380,18 @@ int isolate_or_dissolve_huge_page(struct page *page)
>   
>   	/*
>   	 * Fence off gigantic pages as there is a cyclic dependency between
> -	 * alloc_contig_range and them. Return -ENOME as this has the effect
> +	 * alloc_contig_range and them. Return -ENOMEM as this has the effect

Nit: belongs into previous patch.

>   	 * of bailing out right away without further retrying.
>   	 */
>   	if (hstate_is_gigantic(h))
>   		return -ENOMEM;
>   
> -	return alloc_and_dissolve_huge_page(h, head);
> +	if (page_count(head) && isolate_huge_page(head, list))
> +		ret = 0;
> +	else if (!page_count(head))
> +		ret = alloc_and_dissolve_huge_page(h, head, list);
> +
> +	return ret;
>   }
>   
>   struct page *alloc_huge_page(struct vm_area_struct *vma,
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index bb8321026c0c..5199b9696bab 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1703,8 +1703,9 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
>   	LIST_HEAD(clean_pages);
>   
>   	list_for_each_entry_safe(page, next, page_list, lru) {
> -		if (page_is_file_lru(page) && !PageDirty(page) &&
> -		    !__PageMovable(page) && !PageUnevictable(page)) {
> +		if (!PageHuge(page) && page_is_file_lru(page) &&
> +		    !PageDirty(page) && !__PageMovable(page) &&
> +		    !PageUnevictable(page)) {

Nit: adding to the end of the list would require less modifications ;)

>   			ClearPageActive(page);
>   			list_move(&page->lru, &clean_pages);
>   		}
> 

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ