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

Re: [PATCH v5 5/6] xen/x86: move NUMA scan nodes codes from x86 to common


  • To: Wei Chen <Wei.Chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 10 Oct 2022 10:25:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=USG35lcqYGmV0PxdvXYh3KCA99nEvFvkAAmaVTCXjmQ=; b=d6+V7y9+RnlgSp1oWE8tz8BYDXfULBCxwPBMpJRUe5qx+3MTbsYl5xDhHCu+0bTcMqwzqpJ69TGImGcsi9NkAQZZMg11sUIzV5XOMjXTKkfy/97Iu7/67GJvRgahNGVhv92XdmC09+PUcU6ZL8kCyEiKy0Em9eIqsyus9BbfxZ9J5/sq2U/2yj/ehlNB4lbz0V6Vnkp7BfSHaq/ZO3XvMzPxq64IU4vwXHBbIUNkRUhSdSN1k8bKxkP6cU6dsCEf5Ay7aZEp8HBt2WGj/6iqJkf6/3J57eu+Qnpii+UOenL5M+uIwm02C5LmxFDvHwn5HI8BXL53ItyuXtiYsmb3sw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lymyZagojSFVxGn8zq7ACRAiS5L8QBpF/3y3FXfqfA8uB5WErJolvRp50I6gSWlscx0l2kgDVK3cbFSxzg9mhfqgk9xlWuPPV20orDMJn0uqD8kZZHN/or9OhG0SPI0InFoajVyvG6hmJzaS6P+Fjuxb8gaYySLnSyj9DOdRBAWRtbl9qbWGenygwIVpvZAI2Yi3PWldZjmsWUZ4gO84hSC0NiCMmKjPf7ROZqI2rpSOG1ojbtO8OVHy2eqP6GikFI+nyXxo9oiKs9gPw4N8BLSzQv2DyprLYVLtQeMAXqgb3Yn/ujak2SaZfpP7FoSaZmPkC7REp3WMkJmdnIydAg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: nd <nd@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 10 Oct 2022 08:25:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.10.2022 09:03, Wei Chen wrote:
> On 2022/10/9 15:25, Wei Chen wrote:
>>>>> Even more so an answer to my question would be nice: You'll then have
>>>>> CONFIG_HAS_NUMA_NODE_FWID=y even on Arm (using PXM as mandated by ACPI
>>>>> when in ACPI mode). But then what's the FWID for DT? I know it was me
>>>>> to suggest this build time distinction, but I'm afraid I wasn't doing
>>>>> much good with that (and I'm sorry).
>>>>
>>>> How about introducing a flag for selected NUMA implementation to
>>>> set it in runtime?
>>>> For example:
>>>> bool numa_has_fw_nodeid;
>>>>
>>>> ACPI NUMA will set this flag to 1, but 0 for DT NUMA.
>>>
>>> That's an option alongside going back to what you had in an earlier
>>> version. Another would be (name subject to improvement)
>>>
>>> const char *__ro_after_init numa_fw_nid_name;
>>>
> 
> When I was dealing with this comment, I found that I was still a little 
> unclear:
> 
> When we were introducing "CONFIG_HAS_NUMA_NODE_FWID", we wanted to 
> eliminate the redundant code of:
> if ( fwid_name not equal to "node" )
>      printk(KERN_INFO "NUMA: Node %u %s %u [%"PRIpaddr"%"PRIpaddr"]%s\n",
>             node, fwid_name , arch_nid, start, end - 1,
>             hotplug ? " (hotplug)" : "");
> else
>      printk(KERN_INFO "NUMA: Node %u [%"PRIpaddr", %"PRIpaddr"]%s\n",
>             node, start, end - 1, hotplug ? " (hotplug)" : "");
> 
> But when I am working with numa_fw_nid_name, I find it's still not
> easy to reduce above redundant code. For example:

As said - this attempt to limit redundancy was a mistake when it comes
to the existence of two models in parallel for an arch (with either
one picked at runtime), unless ...

> "NUMA: Node %u %s %u
> When numa_fw_nid_name = NULL, we can print "" for %s, but can't reduce
> the second %u.
> 
> So can we split this message into 3 lines like:
>      printk(KERN_INFO "NUMA: Node %u"...);
>      if (numa_fw_nid_name)
>          printk(KERN_INFO " %s %u"...);
>      printk(KERN_INFO "[%"PRIpaddr"%"PRIpaddr"]%s\n"...);
> 
> Or another option, we can force each NUMA implementation to assign a
> string for numa_fw_nid_name. For example, in DT NUMA, we can assign
> numa_fw_nid_name="SOCKET".

... we can assume numa_fw_nid_name to always be non-NULL (is
there's any way to reach this piece of code). I have no insight whether
"socket" is a correct term to use in the DT case; that would need to be
confirmed by an Arm person.

Jan



 


Rackspace

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