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 39A2139D6EA for ; Mon, 23 Mar 2026 14:01:57 +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=1774274517; cv=none; b=UJObU9L/TC+KBxnuk4o5fzGpO+8spKnhN1IsY2OABtQmf1qfNa5F8ZnjmGyJvj/LfNwlNM2JZjp6TzVO8PKD3EbbCc9s55/PmOV/i1oiKpQgSwOeYH2lE29GXwq3HSJrYo6nMIothsK1M2y5gRxd84R4mOlF6DEt/hh9mBFeFTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274517; c=relaxed/simple; bh=qRBoRCAG1AghwUkxPxW1t9X5uhJ/X4+sJp2KekgxAqQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p8MZUdMYtAfEFOexT8z4sZdJA98vUTJdrEAGsc+HPqZv+43XJo87tB9PdpnsAq8e27RG+uJ+PGb1Dv7AtqcDmflhM2ZHhXJ/Z9x1cxH6bBX+iSXBAJFSIOO0IK3/CdypJv7INkUHCw+aWlo7QnAbp4qihznMUPX4JTN5H9A3sOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eIv7r9gm; 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="eIv7r9gm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B164C4CEF7; Mon, 23 Mar 2026 14:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774274517; bh=qRBoRCAG1AghwUkxPxW1t9X5uhJ/X4+sJp2KekgxAqQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eIv7r9gmkdp2hQEPT+RQwzw0HAh83mEHzwReJJ/Q9UBeyVaChRDaUEzOSoeiJKeK4 n9qKuj1CmKD0NsohFdfzulvf0uXu0NWBBmdnKs3ycY7oOXjXmujJx8wmqneSixxXuk vyfd30GO09g1zf/RFeQ9m6yeAguxw+nbT5kcz8Mgd2G/8ZD1/3KXULj2Pyck95PmJw pg78MTNkrW9Ss8g6U+EAcCHJjx5rxWzOxubohZEPyH9wD71BGLBzA4eumRnKjvevyE U2zXyKD4TgOdp1AlhnLI6rVb69SYqF0PxBYw+kAn8IrPnOI+vc+xiUrJi9KQjvbac4 mQzv3WX2XKB5g== Date: Mon, 23 Mar 2026 16:01:49 +0200 From: Mike Rapoport To: "Lorenzo Stoakes (Oracle)" Cc: Andrew Morton , David Hildenbrand , Kees Cook , "Liam R. Howlett" , Michal Hocko , Suren Baghdasaryan , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] memblock: move reserve_bootmem_range() to memblock.c and make it static Message-ID: References: <20260323072042.3651061-1-rppt@kernel.org> <445a1456-68da-45e7-ac0a-c1ed0cd086c4@lucifer.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <445a1456-68da-45e7-ac0a-c1ed0cd086c4@lucifer.local> On Mon, Mar 23, 2026 at 12:37:51PM +0000, Lorenzo Stoakes (Oracle) wrote: > On Mon, Mar 23, 2026 at 09:20:42AM +0200, Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > reserve_bootmem_region() is only called from > > memmap_init_reserved_pages() and it was in mm/mm_init.c because of its > > dependecies on static init_deferred_page(). > > > > Since init_deferred_page() is not static anymore, move > > reserve_bootmem_region(), rename it to memmap_init_reserved_range() and > > make it static. > > > > Update the comment describing it to better reflect what the function > > does and drop bogus comment about reserved pages in free_bootmem_page(). > > > > Update memblock test stubs to reflect the core changes. > > > > Signed-off-by: Mike Rapoport (Microsoft) > > LGTM and passed local tests so: > > Reviewed-by: Lorenzo Stoakes (Oracle) Thanks! > > --- > > FYI I saw the below when running make in tools/testing/memblock, doesn't look > related to this change but maybe something to address? > > > cc -I. -I../../include -Wall -O2 -fsanitize=address -fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT -c -o memblock.o memblock.c > memblock.c: In function ‘memblock_add_range.isra’: > memblock.c:710:17: warning: ‘end_rgn’ may be used uninitialized [-Wmaybe-uninitialized] > 710 | memblock_merge_regions(type, start_rgn, end_rgn); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > memblock.c:616:42: note: ‘end_rgn’ was declared here > 616 | int idx, nr_new, start_rgn = -1, end_rgn; > | ^~~~~~~ Oddly enough it does not warn in the kernel build, so I kept ignoring this :) Should be fixed indeed. -- Sincerely yours, Mike.