[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <534ACFEE-3FD9-47B2-B3A9-45F898BC9CCF@nvidia.com>
Date: Mon, 10 Mar 2025 13:05:12 -0400
From: Zi Yan <ziy@...dia.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>, Ryan Roberts <ryan.roberts@....com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
David Hildenbrand <david@...hat.com>, Yang Shi <yang@...amperecomputing.com>,
Miaohe Lin <linmiaohe@...wei.com>, Kefeng Wang <wangkefeng.wang@...wei.com>,
Yu Zhao <yuzhao@...gle.com>, John Hubbard <jhubbard@...dia.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, Kairui Song <kasong@...cent.com>
Subject: Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used)
functions for folio_split()
On 10 Mar 2025, at 13:00, Matthew Wilcox wrote:
> On Mon, Mar 10, 2025 at 12:42:06PM -0400, Zi Yan wrote:
>>> Because of the “Careful” comment. But new_folio->* should be fine,
>>> since it is the same as new_head. So I probably can replace all
>>> new_head with new_folio except those VM_BUG_ON_PAGE checks?
>
> Why not also the VM_BUG_ON_PAGE check? I mean:
>
>> @@ -3364,8 +3364,8 @@ static void __split_folio_to_order(struct folio *folio, int old_order,
>> /* ->mapping in first and second tail page is replaced by other uses */
>> VM_BUG_ON_PAGE(new_nr_pages > 2 && new_head->mapping != TAIL_MAPPING,
>> new_head);
>
> VM_BUG_ON_PAGE(new_nr_pages > 2 && new_folio->mapping != TAIL_MAPPING, new_head);
We are checking new_folio but dump new_head, so it can cause some confusion.
But it might not be that bad.
>
> (or we could just ditch the assert entirely; it's not all that useful)
I am open to that.
>
>> - new_head->mapping = head->mapping;
>> - new_head->index = head->index + index;
>> + new_folio->mapping = head->mapping;
>> + new_folio->index = head->index + index;
>
> new_folio->mapping = folio->mapping
> new_folio->index = folio->index +index;
>
> (um, and that index + index looks weird; better name might be just 'i')
OK. Let me make the changes you suggested and fold it to Hugh’s fix patch,
before Andrew picks that up.
Best Regards,
Yan, Zi
Powered by blists - more mailing lists