[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <596b78f8-1630-5379-0b6f-8666a569ad8b@oracle.com>
Date: Tue, 1 Nov 2022 09:40:48 -0700
From: Sidhartha Kumar <sidhartha.kumar@...cle.com>
To: Mike Kravetz <mike.kravetz@...cle.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, songmuchun@...edance.com,
willy@...radead.org, almasrymina@...gle.com, linmiaohe@...wei.com,
minhquangbui99@...il.com, aneesh.kumar@...ux.ibm.com
Subject: Re: [PATCH 2/9] mm/hugetlb_cgroup: convert hugetlb_cgroup_from_page()
to folios
On 10/31/22 9:13 AM, Mike Kravetz wrote:
> On 10/13/22 20:12, Sidhartha Kumar wrote:
>> Introduce folios in __remove_hugetlb_page() by converting
>> hugetlb_cgroup_from_page() to use folios.
>>
>> Also gets rid of unsed hugetlb_cgroup_from_page_resv() function.
>>
>> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
>> ---
>> include/linux/hugetlb_cgroup.h | 39 +++++++++++++++++-----------------
>> mm/hugetlb.c | 5 +++--
>> mm/hugetlb_cgroup.c | 13 +++++++-----
>> 3 files changed, 31 insertions(+), 26 deletions(-)
> Changes look fine. However ...
>
>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>> index 4133ffbbeb50..bcb9bfce32ee 100644
>> --- a/mm/hugetlb.c
>> +++ b/mm/hugetlb.c
>> @@ -1434,9 +1434,10 @@ static void __remove_hugetlb_page(struct hstate *h, struct page *page,
>> bool demote)
>> {
>> int nid = page_to_nid(page);
>> + struct folio *folio = page_folio(page);
>>
>> - VM_BUG_ON_PAGE(hugetlb_cgroup_from_page(page), page);
>> - VM_BUG_ON_PAGE(hugetlb_cgroup_from_page_rsvd(page), page);
>> + VM_BUG_ON_FOLIO(hugetlb_cgroup_from_folio(folio), folio);
>> + VM_BUG_ON_FOLIO(hugetlb_cgroup_from_folio_rsvd(folio), folio);
>>
>> lockdep_assert_held(&hugetlb_lock);
>> if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> ... there is also this a little further in the routine.
>
> if (HPageFreed(page)) {
>
> Should probably change this to?
>
> if (folio_test_hugetlb_freed(folio)) {
>
> Or, is that part of a planned subsequent change?
I will be including this change in a subsequent patch series I plan to
send out this week.
Thanks,
Sidhartha Kumar
Powered by blists - more mailing lists