From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 225562EA75E for ; Fri, 10 Apr 2026 07:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775807364; cv=none; b=EClg5J5Ib0T1zT+4hwMpCevWedwWp8G9yKlh3rlEf2QhltTX8Vv6Qm9uT0qpEWDMJXhGsiB2b9R9+5FJeRP30tVp6eMM4T9Hdyrb9tVq0BmvyTin6yjqLKDokDKkVL/+nGbHrHRQ5dVUzzLkG4VnFpiPrXQWWOwVJQAAX4tPG5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775807364; c=relaxed/simple; bh=eLh6YiJHIO8GFcMkL07shGMnGN684HcjVlVlifjACnY=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=WCQCwJWGeeMv2ETCKEOFVVaVQxXAtTi/vsmLL0GX1qTYjTOb6c95IxhEI+fEFK2thqv3i801MCxupnKVnEoZ+ed8QTkxOiy9EWFBeKVN7dCpiE/KBgxn/m0WJRqSr4Ejuo/2KyzdjsZB4LpboB79nf7VYpqbgrilBl/45Dz32OU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Es7TBB1E; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Es7TBB1E" Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775807361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hOrxchEFccvy90Cdqy57xUzbU6na+pOudQlMDeHeP+U=; b=Es7TBB1EcvjF2i+n+1VSpjVKChww1HEtoszmPCpfyzfPg+FHGUU4bHYufZQJWqih7/IYkm reQajFGglsObNq4ogpi7zsgV9NgEUB9dBM59lXIrLp/4FtJoyrNBgF38c7tvvPODNGibwJ KV47JqWQietpkbIzsotErJbifzrwJ+k= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: Re: [RFC PATCH] mm/sparse: remove sparse_buffer X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: Date: Fri, 10 Apr 2026 15:48:41 +0800 Cc: Mike Rapoport , Muchun Song , Andrew Morton , yinghai@kernel.org, Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <242A2DF3-93E3-4D31-926A-03459AD3095E@linux.dev> References: <20260407083951.2823915-1-songmuchun@bytedance.com> <70EF8E41-31A2-4B43-BABE-7218FD5F7271@linux.dev> <45BF3CAC-2E64-4CA7-A7B8-800FC90930D5@linux.dev> To: "David Hildenbrand (Arm)" X-Migadu-Flow: FLOW_OUT > On Apr 10, 2026, at 15:44, David Hildenbrand (Arm) = wrote: >=20 > On 4/10/26 08:05, Muchun Song wrote: >>=20 >>=20 >>> On Apr 10, 2026, at 11:07, Muchun Song = wrote: >>>=20 >>>=20 >>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>>=20 >>>> memblock always allocates in order, so if there are no other = memblock >>>> allocations between the calls to memmap_alloc(), all these = allocations will >>>> be together and they all will be coalesced to a single region in >>>> memblock.reserved. >>>>=20 >>>>=20 >>>> ... >>>>=20 >>>>=20 >>>> memmap_alloc() will be slower than sparse_buffer_alloc(), = allocating from >>>> memblock is more involved that sparse_buffer_alloc(), but without >>>> measurements it's hard to tell how much it'll affect overall = sparse_init(). >>>=20 >>> I ran a test on a 256GB VM, and the results are as follows: >>>=20 >>> With patch: 741,292 ns >>> Without patch: 199,555 ns >>>=20 >>> The performance is approximately 3.7x slower with the patch applied. >>=20 >> I also tested 512GB of data, and the results were roughly twice that >> of 256GB, so for a 1TB machine, the memory allocation time is only a >> few milliseconds. It seems we don=E2=80=99t need to worry about the = 3.7x >> performance drop. >=20 > Good. Can you incorporate all that into the patch description? >=20 Yes. No problem. > --=20 > Cheers, >=20 > David