linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Zi Yan <ziy@nvidia.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Ryan Roberts <ryan.roberts@arm.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	David Hildenbrand <david@redhat.com>,
	Yang Shi <yang@os.amperecomputing.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Yu Zhao <yuzhao@google.com>, John Hubbard <jhubbard@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kairui Song <kasong@tencent.com>
Subject: Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()
Date: Mon, 10 Mar 2025 16:30:26 +0000	[thread overview]
Message-ID: <Z88ToirSWa_meevw@casper.infradead.org> (raw)
In-Reply-To: <20250307174001.242794-3-ziy@nvidia.com>

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?



  parent reply	other threads:[~2025-03-10 16:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 17:39 [PATCH v10 0/8] Buddy allocator like (or non-uniform) folio split Zi Yan
2025-03-07 17:39 ` [PATCH v10 1/8] xarray: add xas_try_split() to split a multi-index entry Zi Yan
2025-03-07 17:39 ` [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split() Zi Yan
2025-03-10 16:14   ` Zi Yan
2025-03-10 17:32     ` Zi Yan
2025-03-13 14:08       ` Zi Yan
2025-03-10 16:30   ` Matthew Wilcox [this message]
2025-03-10 16:39     ` Zi Yan
2025-03-10 16:42       ` Zi Yan
2025-03-10 17:00         ` Matthew Wilcox
2025-03-10 17:05           ` Zi Yan
2025-03-07 17:39 ` [PATCH v10 3/8] mm/huge_memory: move folio split common code to __folio_split() Zi Yan
2025-03-07 17:39 ` [PATCH v10 4/8] mm/huge_memory: add buddy allocator like (non-uniform) folio_split() Zi Yan
2025-03-07 17:39 ` [PATCH v10 5/8] mm/huge_memory: remove the old, unused __split_huge_page() Zi Yan
2025-03-07 17:39 ` [PATCH v10 6/8] mm/huge_memory: add folio_split() to debugfs testing interface Zi Yan
2025-03-07 17:40 ` [PATCH v10 7/8] mm/truncate: use folio_split() in truncate operation Zi Yan
2025-03-07 17:40 ` [PATCH v10 8/8] selftests/mm: add tests for folio_split(), buddy allocator like split Zi Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z88ToirSWa_meevw@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=hughd@google.com \
    --cc=jhubbard@nvidia.com \
    --cc=kasong@tencent.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@arm.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=yang@os.amperecomputing.com \
    --cc=yuzhao@google.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox