[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXc54xgLxaBSTuaq@casper.infradead.org>
Date: Mon, 11 Dec 2023 16:33:39 +0000
From: Matthew Wilcox <willy@...radead.org>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>,
Ryan Roberts <ryan.roberts@....com>,
Yin Fengwei <fengwei.yin@...el.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Muchun Song <muchun.song@...ux.dev>,
Peter Xu <peterx@...hat.com>
Subject: Re: [PATCH v1 02/39] mm/rmap: introduce and use hugetlb_remove_rmap()
On Mon, Dec 11, 2023 at 04:56:15PM +0100, David Hildenbrand wrote:
> hugetlb rmap handling differs quite a lot from "ordinary" rmap code.
> For example, hugetlb currently only supports entire mappings, and treats
> any mapping as mapped using a single "logical PTE". Let's move it out
> of the way so we can overhaul our "ordinary" rmap.
> implementation/interface.
>
> Let's introduce and use hugetlb_remove_rmap() and remove the hugetlb
> code from page_remove_rmap(). This effectively removes one check on the
> small-folio path as well.
>
> Note: all possible candidates that need care are page_remove_rmap() that
> pass compound=true.
>
> Reviewed-by: Yin Fengwei <fengwei.yin@...el.com>
> Signed-off-by: David Hildenbrand <david@...hat.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> +++ b/mm/rmap.c
> @@ -1482,13 +1482,6 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma,
>
> VM_BUG_ON_PAGE(compound && !PageHead(page), page);
>
> - /* Hugetlb pages are not counted in NR_*MAPPED */
> - if (unlikely(folio_test_hugetlb(folio))) {
> - /* hugetlb pages are always mapped with pmds */
> - atomic_dec(&folio->_entire_mapcount);
> - return;
> - }
Maybe add
VM_BUG_ON_FOLIO(folio_test_hugetlb(folio), folio);
Powered by blists - more mailing lists