linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: shengminghu512 <shengminghu512@qq.com>,
	akpm <akpm@linux-foundation.org>, rppt <rppt@kernel.org>
Cc: "lorenzo.stoakes" <lorenzo.stoakes@oracle.com>,
	"Liam.Howlett" <Liam.Howlett@oracle.com>, vbabka <vbabka@suse.cz>,
	surenb <surenb@google.com>, mhocko <mhocko@suse.com>,
	linux-mm <linux-mm@kvack.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"hu.shengming" <hu.shengming@zte.com.cn>,
	"zhang.run" <zhang.run@zte.com.cn>
Subject: Re: [PATCH v2] mm/memblock: drop redundant 'struct page *' argument from memblock_free_pages()
Date: Tue, 30 Dec 2025 21:16:33 +0100	[thread overview]
Message-ID: <a8abdc11-d008-4abb-8fa5-966ff27e1488@kernel.org> (raw)
In-Reply-To: <tencent_F741CE6ECC49EE099736685E60C0DBD4A209@qq.com>

On 12/29/25 14:52, shengminghu512 wrote:
> From: Shengming Hu <hu.shengming@zte.com.cn>
> 
> memblock_free_pages() currently takes both a struct page * and the
> corresponding PFN. The page pointer is always derived from the PFN at
> call sites (pfn_to_page(pfn)), making the parameter redundant and also
> allowing accidental mismatches between the two arguments.
> 
> Simplify the interface by removing the struct page * argument and
> deriving the page locally from the PFN, after the deferred struct page
> initialization check. This keeps the behavior unchanged while making
> the helper harder to misuse.
> 
> Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
> ---

Reviewed-by: David Hildenbrand (Red Hat) <david@kernel.org>

-- 
Cheers

David


      parent reply	other threads:[~2025-12-30 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29 13:52 shengminghu512
2025-12-30 13:35 ` Mike Rapoport
2025-12-30 20:16 ` David Hildenbrand (Red Hat) [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=a8abdc11-d008-4abb-8fa5-966ff27e1488@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hu.shengming@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=shengminghu512@qq.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=zhang.run@zte.com.cn \
    /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