mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Jianfeng Wang <jianfeng.w.wang@oracle.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] mm: huge_memory: convert __do_huge_pmd_anonymous_page() to use folios
Date: Mon, 22 Apr 2024 20:11:59 +0100	[thread overview]
Message-ID: <Zia2f2EI8LWFE2XA@casper.infradead.org> (raw)
In-Reply-To: <20240422181216.91938-1-jianfeng.w.wang@oracle.com>

On Mon, Apr 22, 2024 at 11:12:16AM -0700, Jianfeng Wang wrote:
> Change __do_huge_pmd_anonymous_page() to take folio as input, as its
> caller has used folio. Save one unnecessary call to compound_head().

I don't like this patch.  It makes the assumption that folios will never
be larger than PMD size, and I don't think that's an assumption that's
going to last another five years.  Look where you had to
do &folio->page:

> +	clear_huge_page(&folio->page, vmf->address, HPAGE_PMD_NR);

> +		entry = mk_huge_pmd(&folio->page, vma->vm_page_prot);

For mk_huge_pmd() in particular, you need to know the precise page, and
not just use the first page of the folio.

      reply	other threads:[~2024-04-22 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 18:12 Jianfeng Wang
2024-04-22 19:11 ` Matthew Wilcox [this message]

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=Zia2f2EI8LWFE2XA@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=jianfeng.w.wang@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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

all inboxes | Powered by JetHome®