lkml.org 
[lkml]   [2022]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/9] mm/hugetlb_cgroup: convert hugetlb_cgroup_from_page() to folios
From


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@oracle.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


\
 
 \ /
  Last update: 2022-11-01 17:42    [W:0.121 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site