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

Re: [PATCH v3 03/17] xen/arm: implement node distance helpers for Arm


  • To: Henry Wang <Henry.Wang@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 24 Apr 2023 13:18:22 +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=z9dKh8YrF6igLz27Jqrhx+ueGiA8Ku8+DNWjTADSGM0=; b=oBswKIVwggv1VdqlYLtj9AlBZDeh7hCjqKk2aFEQhcValC6yWJMym9RY2y2XG0Nxe92CNnzupr9V/rfQVuqyAbQ2wS7PK/07kV6wxBH5c09Pr3RBcxzQnrepQ2UPNXy14T083EOquP1KGujH7xdQusMrkPQDmoGRXuVIx32Mk449Mjcv1nWR/RDHGfdM3IollMDBKRf7LhjA8MiNJQRhjWOT9bvMDPItxytoATbfgSxqyx3tbQQ8urdhnsiy4pLl7JkSqN9yXw7C06wmaGxfaHl61MnngpdRTXnAINM6eHWEqOVd2uuCshgHlDGH2IfRbKWEBZA9s9wS8+vFqIR57g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dOzgqmt9zarBT1KyFH0rtEGb8k71B3sxGZ9bEJJRCHMSh+i0Vp+ExHpEdk2XzRy2ghAtGJguXklCjacDET5PJKBaOT5M3ps312abTITS7Bz0vGhR++xKeQHNKIrZNE9YJK5uYSvyQQ8LOpn6k38fOfetF4XvkEumhn7EH7OJdbtxgQiDzqqkN14+8HQGISoR5SBlqxsnWq8jt5RJugylPDLMttu+J6TKYetEO+D1YYZH39+gftJ7oGVYLTGr1qmOUsMCmSXvcPGvxDbLQNaVBbk+anmH4BIxyMmuQWEDX7adsXWMSXBXXUw3UrOhBiIZDTmX46YvT6spK4g3nBV6Dg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 24 Apr 2023 11:18:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.04.2023 13:02, Henry Wang wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> On 23.04.2023 07:36, Henry Wang wrote:
>>>> -----Original Message-----
>>>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>>>>> However, looking at the code below, don't you mean to have the array
>>>>>> pre-set to all NUMA_NO_DISTANCE?
>>>>>
>>>>> ...I am a bit puzzled about why pre-setting the array to all
>>>>> NUMA_NO_DISTANCE matters here, as I think the node distance map will
>>>>> be populated when parsing the device tree anyway no matter what their
>>>>> initial values.
>>>>
>>>> From this patch alone it doesn't become clear whether indeed all array
>>>> slots (and not just ones for valid nodes) would be populated. I think
>>>> the code in the patch here would better not make itself dependent on
>>>> behavior of code added subsequently (which may change; recall that a
>>>> series may be committed in pieces).
>>>
>>> Correct, I agree. I added a numa_init_distance() function (in patch #12) to
>>> set all values to NUMA_NO_DISTANCE. The numa_init_distance() will be
>>> called in the beginning of numa_init().
>>
>> Why do you need a function for this? As said, this array can be pre-set at
>> compile time (unless I'm overlooking something).
> 
> Sorry I overlooked this comment, correct me if I am wrong, but IIUC we
> can only pre-set the 2D array to 0 at the compile time. Could you please
> elaborate a bit more about the code in your mind? Thanks!

static unsigned char __ro_after_init
node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = {
    [0 ... MAX_NUMNODES - 1] = { [0 ... MAX_NUMNODES - 1] = NUMA_NO_DISTANCE }
};

or even (limiting redundancy a little)

static unsigned char __ro_after_init
node_distance_map[][MAX_NUMNODES] = {
    [0 ... MAX_NUMNODES - 1] = { [0 ... MAX_NUMNODES - 1] = NUMA_NO_DISTANCE }
};

Jan



 


Rackspace

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