From: David Hildenbrand <david@redhat.com>
To: Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>,
Michal Hocko <mhocko@kernel.org>,
Muchun Song <songmuchun@bytedance.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH v9 6/7] mm: Make alloc_contig_range handle in-use hugetlb pages
Date: Fri, 16 Apr 2021 10:36:01 +0200 [thread overview]
Message-ID: <02de399f-1ecf-98d6-6a78-1301f9a97d5a@redhat.com> (raw)
In-Reply-To: <20210416070023.4742-7-osalvador@suse.de>
> -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@redhat.com>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2021-04-16 8:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 7:00 [PATCH v9 0/7] Make alloc_contig_range handle Hugetlb pages Oscar Salvador
2021-04-16 7:00 ` [PATCH v9 1/7] mm,page_alloc: Bail out earlier on -ENOMEM in alloc_contig_migrate_range Oscar Salvador
2021-04-16 7:00 ` [PATCH v9 2/7] mm,compaction: Let isolate_migratepages_{range,block} return error codes Oscar Salvador
2021-04-16 7:00 ` [PATCH v9 3/7] mm,hugetlb: Drop clearing of flag from prep_new_huge_page Oscar Salvador
2021-04-16 7:00 ` [PATCH v9 4/7] mm,hugetlb: Split prep_new_huge_page functionality Oscar Salvador
2021-04-16 7:00 ` [PATCH v9 5/7] mm: Make alloc_contig_range handle free hugetlb pages Oscar Salvador
2021-04-16 9:49 ` Baoquan He
2021-04-16 12:14 ` Oscar Salvador
2021-04-16 7:00 ` [PATCH v9 6/7] mm: Make alloc_contig_range handle in-use " Oscar Salvador
2021-04-16 8:36 ` David Hildenbrand [this message]
2021-04-16 7:00 ` [PATCH v9 7/7] mm,page_alloc: Drop unnecessary checks from pfn_range_valid_contig Oscar Salvador
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02de399f-1ecf-98d6-6a78-1301f9a97d5a@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=osalvador@suse.de \
--cc=songmuchun@bytedance.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).