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 C471E37F011 for ; Tue, 21 Apr 2026 06:08:36 +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=1776751716; cv=none; b=brur1Qn+p8OZ8dNPYR+TMAgvY5GnPmxJ2t8NbimljuWm+QRTVdt0cUUO0AtB6+0BNcSKMDS5IAhh32xfIYjt/AfD4TkhmzvaWgsmaWKrmlu3wfFdJkdVwqm9Xii3L2HkHVKR5cv6Oi5aLHOJz4MVLhOavmeaOSF7InGxE61wt6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776751716; c=relaxed/simple; bh=W/hzbip07LNU/tDJ2aO3ZCidj5JMSONEyovcM7R7tZM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TFJYT4xqxeXnwzNO6oCCFBcwiO/HnPjlyLSi8EYrpYTQT4B6fMH1nq31ImD2CUVSx4S2vDFf6xKITYb0SKJq0zMiBsVvpT/lUjJzADRpxUgoNFOETRpgOcp6by+4dAp/8Gr9BG9FE/Zecb3LjkgfIncIV9d7SBBAnKOJ3ltsTe0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mxpOYq0q; 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="mxpOYq0q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 402A3C2BCB0; Tue, 21 Apr 2026 06:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776751716; bh=W/hzbip07LNU/tDJ2aO3ZCidj5JMSONEyovcM7R7tZM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mxpOYq0qMk/X+UYLwyY+5jPb27dG3yNzGaRGqgOSBB6EGi0gmlrWIwn7HZ/lBe3lu 2sehwQcnzYl2XIlQQqfBpoirREgd4El6lkSxTo4Rt3YDaeRdze7PVcExaIUVo+FuJD hPQg2l62q4NOQ8v6SlErDOF1hWWn1jfhQVuHqn77E21IsRN+yfx8/HViLmi2yIyU+D Osqj/aZeE32cgTH9AkM1ZRYuhvwJb1+sA+kfNSYEJ2+eAH7VelseY7ukM6u/ZZyJXZ aKJl3xSyRlc67o/CeFYGxzS8PV01KjlFDcv41EJyCMu5+d5IILkH9aKyRtxw5SvxTc W/oC5ziCgPafg== Date: Tue, 21 Apr 2026 09:08:27 +0300 From: Mike Rapoport To: =?utf-8?B?TWljaGHFgiBDxYJhcGnFhHNraQ==?= Cc: Evangelos Petrongonas , Pasha Tatashin , Pratyush Yadav , Alexander Graf , Samiullah Khawaja , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan Subject: Re: [PATCH v8 1/2] kho: fix deferred initialization of scratch areas Message-ID: References: <20260416110654.247398-1-mclapinski@google.com> <20260416110654.247398-2-mclapinski@google.com> 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: On Mon, Apr 20, 2026 at 03:11:03PM +0200, Michał Cłapiński wrote: > On Thu, Apr 16, 2026 at 6:13 PM Mike Rapoport wrote: > > > > On Thu, Apr 16, 2026 at 05:06:10PM +0200, Michał Cłapiński wrote: > > > On Thu, Apr 16, 2026 at 4:45 PM Mike Rapoport wrote: > > > > > > > > Hi Michal, > > > > > > > > On Thu, Apr 16, 2026 at 01:06:53PM +0200, Michal Clapinski wrote: > > > > > @@ -2262,6 +2253,12 @@ static void __init memmap_init_reserved_range(phys_addr_t start, > > > > > * access it yet. > > > > > */ > > > > > __SetPageReserved(page); > > > > > + > > > > > +#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH > > > > > > > > No need for #ifdef here, there's a stub returning false for > > > > CONFIG_MEMBLOCK_KHO_SCRATCH=n case. > > > > > > In all 3 places the #ifdef is there because MIGRATE_CMA might be > > > undefined. I already broke mm-new branch in the past because of that. > > > > Hmm, that hurts :/ > > > > The best I can think of is to add a static inline in memblock.h and ifdefs > > around it. > > Sorry, I don't understand what you mean. What would that static inline contain? Something like this: #ifdef CONFIG_MEMBLOCK_KHO_SCRATCH static inline enum migratetype kho_scratch_migratetype(unsigned long pfn, enum migratetype mt) { if (memblock_is_kho_scratch_memory(PFN_PHYS(pfn))) return MIGRATE_CMA return mt; } #else static inline enum migratetype kho_scratch_migratetype(unsigned long pfn, enum migratetype mt) { return mt; } #endif Can't say I'm happy about the name, but could not think of something better. > > > > > + if (memblock_is_kho_scratch_memory(PFN_PHYS(pfn)) && > > > > > + pageblock_aligned(pfn)) > > > > > + init_pageblock_migratetype(page, MIGRATE_CMA, false); > > > > > +#endif > > > > > } > > > > > } > > > > -- > > Sincerely yours, > > Mike. -- Sincerely yours, Mike.