From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CE4EC433F5 for ; Wed, 22 Dec 2021 11:41:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 295416B0078; Wed, 22 Dec 2021 06:41:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 220FE6B007B; Wed, 22 Dec 2021 06:41:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 098516B007D; Wed, 22 Dec 2021 06:41:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id EBA3C6B0078 for ; Wed, 22 Dec 2021 06:41:23 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B0D54181AC9C6 for ; Wed, 22 Dec 2021 11:41:23 +0000 (UTC) X-FDA: 78945239646.07.613CA6E Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf21.hostedemail.com (Postfix) with ESMTP id 3074C1C0041 for ; Wed, 22 Dec 2021 11:41:19 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D483B212B9; Wed, 22 Dec 2021 11:41:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1640173281; h=from:from:reply-to: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=Ps07gwicxIa6if6MGpsmNI9n6pnErUxgnZxQzcd6Lbk=; b=sP3nnik3EJAsx3SWWYmI+EC3wsLNXWfVbcgv3VLqEXO8fzAegf2b6Sv4hNKy/1wb8fF78n yDahY3G7ZuiIOAuh2CvzSLLFls2YtMKRdz0LdF2BGksXesvgavLjoLsPDVvl5wba9Dv2zr PuTQcX61PzWQjpPDl++F1vLDoiqNCqc= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B8BB1A3B84; Wed, 22 Dec 2021 11:41:21 +0000 (UTC) Date: Wed, 22 Dec 2021 12:41:18 +0100 From: Michal Hocko To: Alexey Makhalov Cc: Dennis Zhou , Eric Dumazet , "linux-mm@kvack.org" , Andrew Morton , David Hildenbrand , Oscar Salvador , Tejun Heo , Christoph Lameter , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH v3] mm: fix panic in __alloc_pages Message-ID: References: <2291C572-3B22-4BE5-8C7A-0D6A4609547B@vmware.com> <7D1564FA-5AC6-47F3-BC5A-A11716CD40F2@vmware.com> <078460FE-84C4-442C-BD80-97DB90557809@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <078460FE-84C4-442C-BD80-97DB90557809@vmware.com> Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=sP3nnik3; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3074C1C0041 X-Stat-Signature: 33gj61uccf99eemjirwoeeuj95spn1k4 X-HE-Tag: 1640173279-754852 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 21-12-21 20:23:34, Alexey Makhalov wrote: >=20 >=20 > > On Dec 21, 2021, at 1:46 AM, Michal Hocko wrote: > >=20 > > On Tue 21-12-21 05:46:16, Alexey Makhalov wrote: > >> Hi Michal, > >>=20 > >> The patchset looks good to me. I didn=E2=80=99t find any issues duri= ng the testing. > >=20 > > Thanks a lot. Can I add your Tested-by: tag? > Sure, thanks. Thanks I will add those then. =20 > >> I have one concern regarding dmesg output. Do you think this messagi= ng is > >> valid if possible node is not yet present? > >> Or is it only the issue for virtual machines? > >>=20 > >> Node XX uninitialized by the platform. Please report with boot dmes= g. > >> Initmem setup node XX [mem 0x0000000000000000-0x0000000000000000] > >=20 > > AFAIU the Initmem part of the output is what concerns you, right? Yea= h, > First line actually, this sentence =E2=80=9CPlease report with boot dme= sg.=E2=80=9D. But > there is nothing to fix, at least for VMs. I am still not sure because at least x86 aims at handling that at the platform code. David has given us a way to trigger this from kvm/qemu so I will play with that. I can certainly change the wording but this whole thing was meant to do a fixup after the arch specific code has initialize= d everything. > > that really is more cryptic than necessary. Does this look any better= ? > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 34743dcd2d66..7e18a924be7e 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -7618,9 +7618,14 @@ static void __init free_area_init_node(int nid= ) > > pgdat->node_start_pfn =3D start_pfn; > > pgdat->per_cpu_nodestats =3D NULL; > >=20 > > - pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid, > > - (u64)start_pfn << PAGE_SHIFT, > > - end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0); > > + if (start_pfn !=3D end_pfn) { > > + pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid, > > + (u64)start_pfn << PAGE_SHIFT, > > + end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0); > > + } else { > > + pr_info("Initmem setup node %d as memoryless\n", nid); > > + } > > + > > calculate_node_totalpages(pgdat, start_pfn, end_pfn); > >=20 > > alloc_node_mem_map(pgdat); > Second line looks much better. OK, I will fold that in. I think it is more descriptive as well. >=20 > Thank you, > =E2=80=94Alexey >=20 --=20 Michal Hocko SUSE Labs