[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y73bP5CFT/8T/DvO@casper.infradead.org>
Date: Tue, 10 Jan 2023 21:40:15 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, songmuchun@...edance.com,
mike.kravetz@...cle.com, jhubbard@...dia.com
Subject: Re: [PATCH mm-unstable v2 8/8] mm/hugetlb: convert
demote_free_huge_page to folios
On Tue, Jan 10, 2023 at 03:28:21PM -0600, Sidhartha Kumar wrote:
> @@ -3505,6 +3505,7 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed)
> {
> int nr_nodes, node;
> struct page *page;
> + struct folio *folio;
>
> lockdep_assert_held(&hugetlb_lock);
>
> @@ -3518,8 +3519,8 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed)
> list_for_each_entry(page, &h->hugepage_freelists[node], lru) {
> if (PageHWPoison(page))
> continue;
> -
> - return demote_free_huge_page(h, page);
> + folio = page_folio(page);
> + return demote_free_hugetlb_folio(h, folio);
> }
> }
Can't this be
list_for_each_entry(folio, &h->hugepage_freelists[node], lru)
which avoids the call to page_folio() here.
I think the call to PageHWPoison is actually wrong here. That would
only check the hwpoison bit on the first page, whereas we want to know
about the hwpoison bit on any page (don't we?) So this should be
folio_test_has_hwpoisoned()?
Or is that a THP-thing that is different for hugetlb pages?
Powered by blists - more mailing lists