Re: [PATCH v7 5/7] mm: Make alloc_contig_range handle free hugetlb pages
From: Oscar Salvador
Date: Wed Apr 14 2021 - 00:54:29 EST
On Tue, Apr 13, 2021 at 03:29:02PM -0700, Mike Kravetz wrote:
> > spin_lock_irq(hugetlb_lock)
> > 1) update_and_free_page
> > PageHuge() == F
> > __free_pages()
> > 2) enqueue_huge_page
> > SetPageHugeFreed()
> > spin_unlock(&hugetlb_lock)
>
> Very small nit, the above should be spin_unlock_irq(&hugetlb_lock)
Right, I missed it somehow.
> > + /*
> > + * The page might have been dissolved from under our feet, so make sure
> > + * to carefully check the state under the lock.
> > + * Return success when racing as if we dissolved the page ourselves.
> > + */
> > + spin_lock_irq(&hugetlb_lock);
> > + if (PageHuge(page)) {
> > + head = compound_head(page);
> > + h = page_hstate(head);
> > + } else {
> > + spin_unlock(&hugetlb_lock);
>
> Should be be spin_unlock_irq(&hugetlb_lock);
>
> Other than that, it looks good.
Yeah, I will amend it in the next version.
Thanks Mike!
--
Oscar Salvador
SUSE L3