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 06E253D6463 for ; Tue, 14 Apr 2026 12:11:30 +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=1776168691; cv=none; b=HP98q+0VyCOd8r0aUBI2eu1VBBlZ8R3WNQzUWoMCMLWmAa6vGpJL8qy7uwhso1c49QD633KHbrAYl8AIVX+bC+SVmUwbDwwda7gZOvCLu/Jm3eD/sIorHg7VOqPMReppd2jr4lM4CriFCYEMFOLeb35bCSP4I9cvJwHvhAsCfPA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776168691; c=relaxed/simple; bh=3AMLjyUGD+ddYpwxDxBklxSX3OdAWMZ2H9ltEQTzFd4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ra807XVxwLJhgtrJvDNGOoEVXlWKALzRrbkqrKutLbYpW6raEk0SlboFUlisq/EL64E3j+KOnewZEJO0vr9SOWACUorP+7TkrkVXNMgAAOdVG+pZJGBKjF37wlhVQTnyTpqpdIqy2XRlQRUECx7ye4xtZiPvu14Uimo+nH8HNtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XpFmzQXd; 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="XpFmzQXd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24C3CC19425; Tue, 14 Apr 2026 12:11:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776168690; bh=3AMLjyUGD+ddYpwxDxBklxSX3OdAWMZ2H9ltEQTzFd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XpFmzQXdTU+txPAX4O4mPOREpMLZXa2w4P12fq4IhcB5mwsA0ApNrgCrMyMV3Ghvg 7bM/f5t1MNAaSxmSf73TOvpGHpnM+ZSwEkkTwRnzW5TP8IHRUDI7m2BLwIIXZwS76R 6iGW+4oHwTwsVnq+eoOq2cxVDAHBG5EqJrP0pEzTgGms84mFox2aIO+tu6tdMspLOo rO46EWeynG+gAazL0aQjWVBniaZusPsVLFr470i2gKKVTzfUIOFizbd+uDpogU7kaO pFKP+x0YKmytshTGzYIS1dYzUWNboabP4Vi5XidMripAasArOBdjmneSOEWc/cyF5B KEyfeqVVOopTQ== Date: Tue, 14 Apr 2026 15:11:23 +0300 From: Mike Rapoport To: "David Hildenbrand (Arm)" Cc: Muchun Song , Andrew Morton , Muchun Song , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/sparse: Remove sparse buffer pre-allocation mechanism Message-ID: References: <20260410092419.2446420-1-songmuchun@bytedance.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=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Apr 13, 2026 at 09:02:43PM +0200, David Hildenbrand (Arm) wrote: > > - > > -void * __meminit sparse_buffer_alloc(unsigned long size) > > -{ > > - void *ptr = NULL; > > - > > - if (sparsemap_buf) { > > - ptr = (void *) roundup((unsigned long)sparsemap_buf, size); > > - if (ptr + size > sparsemap_buf_end) > > - ptr = NULL; > > - else { > > - /* Free redundant aligned space */ > > - if ((unsigned long)(ptr - sparsemap_buf) > 0) > > - sparse_buffer_free((unsigned long)(ptr - sparsemap_buf)); > > - sparsemap_buf = ptr + size; > > This code implied, that we would usually get contiguous memory sections > (on the same node) to have contiguous PFNs in the SPARSE !VMEMMAP case. > That will no longer be the case (reliably). > > The code must be prepared to handle that, so I guess that is fine. And > we don't care that much about SPARSE !VMEMMAP. I've started to hunt them down ;-P https://lore.kernel.org/all/20260413104649.852228-1-rppt@kernel.org/ > Acked-by: David Hildenbrand (Arm) > > -- > Cheers, > > David -- Sincerely yours, Mike.