[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [XEN RFC PATCH 03/40] xen/x86: Initialize memnodemapsize while faking NUMA node


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 13 Aug 2021 07:26:38 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=waBnRL6mZlYP/FHo3pZ55grBJQsKkASeMrp/wNsqN6E=; b=dhOxhHrtmrRZx1YHgSzhAyDQFNX2lTTN+aBgzQkgMzXK+blZeypRPK8Jc8MUJUuJpnQtT2BlqCH91DVU//yCBJfwASGOsYd2IuFzSxVtEn+ZApEuh6tDFKP0HA8oMcXu6sWeFXmi7kYFoUtnVSQrXlh4pweFb5UNNj+2iQcsvGLTRnsbBjyG9Jhjbhm5BFWuSIp93wbHwRil+KYoFdN6H073McmjZ1dK2G4BwvGAWo97lWB4wKG+XPMDzWI/cFuVDIxAaqTZ/FN2qKJB6lgoLOqitQfDJdpYWcPqBpv/KNjPoUQclVs5E40zG6u2a4jZZI1yd5rTuN2zdhV9MQ58Cg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J1YLTtOQ2psqFrzwrR5MIoDbY6CUyNBsptglAILBj1VOorMGU+gLWlrUBtHS9xB/eeE39vf0DsyZGrigaaNHpLhGg2NJp+02aokHaCD9BDpJQcetsozy+mWLXXz+41sWXmXoJNoWdIRBrEarn686Y1GIua14slHYilzdLrLh1Q7EkfQOiAjv+JH9jTALWfiSLRLJuQxYeSeP1rIwGEhh3sUU7WL9vjVIeSxIs/4Rz9OqdGN0oEnSnxGDzrTGuRJYUXAKnkjhAKugtUXxgnshcpzeoHpWyAIa69D7quLj89X56wNiq/h1Sldobjqe0r8UEo3mFvVYVW25qa9z5LK7JQ==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>
  • Delivery-date: Fri, 13 Aug 2021 07:27:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjpsc6z0fOQXTYEKFO+6xoMr0S6twAXCAgAECu5A=
  • Thread-topic: [XEN RFC PATCH 03/40] xen/x86: Initialize memnodemapsize while faking NUMA node

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2021年8月12日 23:33
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx; sstabellini@xxxxxxxxxx; julien@xxxxxxx
> Subject: Re: [XEN RFC PATCH 03/40] xen/x86: Initialize memnodemapsize
> while faking NUMA node
> 
> On 11.08.2021 12:23, Wei Chen wrote:
> > When system turns NUMA off or system lacks of NUMA support,
> > Xen will fake a NUMA node to make system works as a single
> > node NUMA system.
> >
> > In this case the memory node map doesn't need to be allocated
> > from boot pages. But we should set the memnodemapsize to the
> > array size of _memnodemap. Xen hadn't done it, and Xen should
> > assert in phys_to_nid. But because x86 was using an empty
> > macro "VIRTUAL_BUG_ON" to replace ASSERT, this bug will not
> > be triggered.
> 
> How about we promote VIRTUAL_BUG_ON() to expand to at least ASSERT()?
> 

That would be good. Frankly, we discovered this because we used ASSERT
in Arm and then noticed that x86 was using VIRTUAL_BUG_ON.

> > --- a/xen/arch/x86/numa.c
> > +++ b/xen/arch/x86/numa.c
> > @@ -270,6 +270,8 @@ void __init numa_initmem_init(unsigned long
> start_pfn, unsigned long end_pfn)
> >      /* setup dummy node covering all memory */
> >      memnode_shift = BITS_PER_LONG - 1;
> >      memnodemap = _memnodemap;
> > +    memnodemapsize = ARRAY_SIZE(_memnodemap);
> 
> But this doesn't reflect reality then, does it? We'd rather want to
> set the size to 1, I would think.
> 

Yes, you're right. Actually, we just only used 1 slot. But furthermore,
memnodemap[0] may be set in acpi_scan_nodes, but acpi_scan_nodes doesn't
reset memnodemap when it failed. I think maybe we can add:
    memnodemap[0] = 0;
    memnodemapsize = 1;
How do you think about it?

> Jan


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.