From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDE4721638D for ; Tue, 30 Dec 2025 20:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767125800; cv=none; b=Xfz+ZuGrBuzARSRpYNnjVRGY7zBTVK+Ws07lf7yFm6QEFzQkyBKla05m9Ho8d3SiJBzDtG1iXPhNgRnx102EEfnPSBSi7XuVEKB1AWIx0Mic+CgikwnEQ0PZTri82oLAAqyr6Tb4kAbTliuX/UfH4FWIT8RO3GAoebMgRXAR7l8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767125800; c=relaxed/simple; bh=fAIoBBiDaqC0FsW9SjJVK0gWBAByeEaSyWf11y9MmtM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dU3NZH7D6CbYHpaYwwJMD+bPw6gaz4JFXnliZGiPtM3fYzNEEFiB2MyXvj0uoYDuHGEiLPqfsQWJyLS7Z7W24JdG4KaEGCOcTBrkZfEp7snj9CAwRCF5a+gYpI6kP90c6xc//nqQiErX6zavT1x03PS498n/fa2N/TYWYLqTUfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OYzOxM/y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OYzOxM/y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9921BC116D0; Tue, 30 Dec 2025 20:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767125799; bh=fAIoBBiDaqC0FsW9SjJVK0gWBAByeEaSyWf11y9MmtM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OYzOxM/yOBl0NCcvVYwccwhVcqhiBHOnxZr709F4oZqG8RxUryMZT/YRDLNdqUL5o MjV2T0vkwD/gJrpiT7dj+ofSA+rQgcRWtzgy3km5x5edpSQBvKFIkVQqeVg7lTruuk c3woRauXso35KcKKpBqNKpXxI8kQ8R+PNTUH0KW+KIVXTjKE97VUvjt+pXESKROSbL ITpS/SnYjOYLVGpUy6zRGUFvuSVTt+tjKqx0ZwFwWm3h2FYm+NfEBr6i6bXkAyKf5a ozY2pp9T8F6w5O5e+bEVlYvROcQZusMoz1J4TxucAAMSdFrlOkIdl58/sWTYeazRN/ A4jJBbe1ehqXQ== Message-ID: Date: Tue, 30 Dec 2025 21:16:33 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] mm/memblock: drop redundant 'struct page *' argument from memblock_free_pages() To: shengminghu512 , akpm , rppt Cc: "lorenzo.stoakes" , "Liam.Howlett" , vbabka , surenb , mhocko , linux-mm , linux-kernel , "hu.shengming" , "zhang.run" References: From: "David Hildenbrand (Red Hat)" Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/29/25 14:52, shengminghu512 wrote: > From: Shengming Hu > > 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 > --- Reviewed-by: David Hildenbrand (Red Hat) -- Cheers David