[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z88ToirSWa_meevw@casper.infradead.org>
Date: Mon, 10 Mar 2025 16:30:26 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Zi Yan <ziy@...dia.com>
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 Fri, Mar 07, 2025 at 12:39:55PM -0500, Zi Yan wrote:
> + for (index = new_nr_pages; index < nr_pages; index += new_nr_pages) {
> + struct page *head = &folio->page;
> + struct page *new_head = head + index;
> +
> + /*
> + * Careful: new_folio is not a "real" folio before we cleared PageTail.
> + * Don't pass it around before clear_compound_head().
> + */
> + struct folio *new_folio = (struct folio *)new_head;
[...]
> + /* ->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);
> + new_head->mapping = head->mapping;
> + new_head->index = head->index + index;
Why are you using new_head->mapping and ->index instead of new_folio?
Powered by blists - more mailing lists