From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 E34632F49FD for ; Tue, 28 Apr 2026 07:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777363074; cv=none; b=Fd5u+MDpAlOTPLBBwEyCwWLOfiUsAtmw2oIx10D77X0hrXw7lECc/MMhbDZn5A3QfeIItD0UztTU0+FQ0Dq+B+LOznRhtuAVPx+q0yjI9KsvzCcqKoPjaYzHpPkWfVn4w+I9X5dI8oP6IJtoF64Q2+hQ2AgtYrc7jgM3ZMeEwbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777363074; c=relaxed/simple; bh=PenTrJaeo5j0aotuFDbzteeYs2rmv8lB2FFFZZ/um3o=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=sxuSyDVLEXJU4+2RtY0T22GR4j1yVvPiaseF8dxQrgo37+An3dAPgOlusaStfW8x8ZAw6C8rlVq7zMsckcLbnWrF1Anjk0B9jec+EMoUVdONvXXRBnPt9rU2wQvkjdm35uehLfkF1XR/UM1tNCBN2LhXJVwkT/690v7qKvKlUpo= 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=I67jg08K; arc=none smtp.client-ip=95.215.58.172 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="I67jg08K" Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1777363069; 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=UMRaGncdlPYxN1RUUBUZsd/r+eI8zgEI90AUf2jmcXs=; b=I67jg08K9MTWM+Rp0bC6VtfePNqxPPzYzJsPNEI3p5ur2b9K7XYdnKpkBR9fRfkr25oVEB n7JBacRYfngy9IR6h1JqBxK5g8RyaKSpCCjzpueX4BqCLTDPbfnWzDTLB54qC7dANsXAcZ zy96Z+6MjUTC8/9l1AerSvNuUO+cALA= 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: [PATCH 09/49] mm: panic on memory allocation failure in sparse_init_nid() X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: Date: Tue, 28 Apr 2026 15:57:23 +0800 Cc: Muchun Song , Andrew Morton , David Hildenbrand , Oscar Salvador , Michael Ellerman , Madhavan Srinivasan , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Nicholas Piggin , Christophe Leroy , aneesh.kumar@linux.ibm.com, joao.m.martins@oracle.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <0C4BACC0-0BEF-4F38-BC8D-1B2A8584AEC8@linux.dev> References: <20260405125240.2558577-1-songmuchun@bytedance.com> <20260405125240.2558577-10-songmuchun@bytedance.com> <96DB49C7-A7C2-4F53-8321-FF4A4ECDFF95@linux.dev> To: Mike Rapoport X-Migadu-Flow: FLOW_OUT > On Apr 28, 2026, at 15:32, Mike Rapoport wrote: >=20 > Hi Muchun, >=20 > On Tue, Apr 28, 2026 at 03:02:14PM +0800, Muchun Song wrote: >>=20 >>>> diff --git a/mm/sparse.c b/mm/sparse.c >>>> index effdac6b0ab1..5c12b979a618 100644 >>>> --- a/mm/sparse.c >>>> +++ b/mm/sparse.c >>>> @@ -354,19 +354,15 @@ static void __init sparse_init_nid(int nid, = unsigned long pnum_begin, >>>> unsigned long map_count) >>>> { >>>> unsigned long pnum; >>>> - struct page *map; >>>> - struct mem_section *ms; >>>> - >>>> - if (sparse_usage_init(nid, map_count)) { >>>> - pr_err("%s: node[%d] usemap allocation failed", __func__, nid); >>>> - goto failed; >>>> - } >>>>=20 >>>> + if (sparse_usage_init(nid, map_count)) >>>> + panic("The node[%d] usemap allocation failed\n", nid); >>>=20 >>> Please consider using memblock_alloc_or_panic() in = sparse_usage_init(), it >>> would simplify the code even more. >>=20 >> Hi Mike, >>=20 >> Yes. I have several more updates for v2. Please hold off on reviewing >> the current version to avoid wasting your time; I=E2=80=99ll send the = new one >> over shortly. >=20 > Thanks for the heads up! > I'll stop for now :) Thanks for the quick response! To clarify, the first few patches didn't change much, so your feedback on those is still very relevant and much appreciated. The major updates are in the later parts of the series, so I'm glad I caught you before you spent time on those. I=E2=80=99ll get the new version shortly. Thanks again! >=20 >> Thanks. >=20 > --=20 > Sincerely yours, > Mike.