From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 471423B38A1 for ; Thu, 30 Jul 2026 07:23:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785396233; cv=none; b=dD3SKxOS0vyGlSpr1tn+C7/YsWwFAA0reqUyKZKS5C4FlmVx2WkHCaebNsSPpQXya9KfCX/xZUxQLANfo7fmN/MeSNFT75DGYv26Aq5JL9taBxLkF6rDtlO/txYNZ5kRoxU3mcvvJxOKuK98/aUTSH9tlwXxy/JuG7WLK4nOJMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785396233; c=relaxed/simple; bh=FEqsN3OFek1vPND+LEeqXaR8wEOaRIpxn9TutXKWpfc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uvd9OUXFgPA6oQ+PiMycksxYsUGYsWFP53w4mpmvPKe8T65o5FSbVzPdLEk0JbjdjgwekJ+xsVcwRiqLhyRaiJ8ZpUyp5zGtI9UmljHRrekxxdnbcr51xaSy/pTHiWu+pY4/t0ayRx6TZRqLIRSUwQ5novkXkMYMRqAdjcGB/lg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jHj6GHG+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jHj6GHG+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 133881F000E9; Thu, 30 Jul 2026 07:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785396231; bh=Os9dgFvLa7OaBZRPPv98Vo5UROeltiAo6YFGnDGfHRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=jHj6GHG+B6LgtjHEN9lD3r0pHdLDN+4kYoIS1VogXbaHwhDQ+DRNw19Wtm3HcxLVv iAF5ezxDHjmMOOm4WuZQypQ/XfMT4Pw6Y4ybYPZwHN6f4GDG6DIfbgwpOp3GAZyVT9 OfRTqZ51g49gULmex43tFprNxYVrVBkKDfFVow2rJa8asavexLSTKdQoT7CSUiF93T YtdwNIe8jQPzVp+WdhrhWq0DPLI8WOshgBVxTWWl1Kud5DYndfXSqA4kvyJEzwTyE5 2MAxFIhxHhTM02fFqUhgN+JXPlGtks6I/DHxvDiBX09F2bKGjgiH9dDlqzT9bghJhg L8lfRYaJWm2jQ== Date: Thu, 30 Jul 2026 10:23:44 +0300 From: Mike Rapoport To: Pratyush Yadav Cc: Pasha Tatashin , Alexander Graf , Muchun Song , Oscar Salvador , David Hildenbrand , Andrew Morton , Jason Miu , Jork Loeser , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 17/22] mm/mm_init: don't rely on memblock to get KHO scratch migratetype Message-ID: References: <20260729145610.2827231-1-pratyush@kernel.org> <20260729145610.2827231-18-pratyush@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260729145610.2827231-18-pratyush@kernel.org> On Wed, Jul 29, 2026 at 04:56:02PM +0200, Pratyush Yadav wrote: > From: "Pratyush Yadav (Google)" > > Currently struct page init via memmap_init() or deferred_init_memmap() > only queries the migrate type from KHO for each discrete memory range. > That works currently since KHO scratch memory has a different memory > type so it is always it its own region. > > An upcoming patch will add support for discovering blocks of memory with > no preservations and it will mark it as MEMBLOCK_KHO_SCRATCH to allow > allocations from them. This can lead to the bootmem KHO scratch areas to > be merged into larger free ranges. This merging breaks the selection of > migrate type. > > Get rid of memblock_is_kho_scratch_memory(). Instead, use > kho_scratch_overlap() to decide the migrate type of the PFN. Since > kho_scratch_migratetype() only uses KHO functions, move it to > kexec_handover.h. > > Instead of calling kho_scratch_migratetype() once for each free range, > call it once for each pageblock. Update > pageblock_migratetype_init_range() and memmap_init_range() to do so. > > Since the migrate type is now evaluated for each pageblock and not each > free range, drop the migratetype arguments to deferred_free_pages() and > memmap_init_zone_range() and use MIGRATE_MOVABLE directly. > > Signed-off-by: Pratyush Yadav (Google) > --- > include/linux/kexec_handover.h | 15 +++++++++++++++ > include/linux/memblock.h | 19 ------------------- > mm/memblock.c | 10 ---------- > mm/mm_init.c | 27 +++++++++++++-------------- > 4 files changed, 28 insertions(+), 43 deletions(-) > > diff --git a/include/linux/kexec_handover.h b/include/linux/kexec_handover.h > index 18ba417f1ada..c83ec4a15fe7 100644 > --- a/include/linux/kexec_handover.h > +++ b/include/linux/kexec_handover.h > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include Should have been mm.h, kbuild bot is unhappy otherwise :) https://lore.kernel.org/all/202607301001.ARjK0D4v-lkp@intel.com I can fix it while applying. -- Sincerely yours, Mike.