[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v4 09/17] xen/arm: introduce a helper to parse device tree NUMA distance map
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Wed, 26 Apr 2023 06:29:51 +0000
- Accept-language: zh-CN, 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NHlVS/xIpZ4NMvOTHhO8WrzzPUxd4UXeced3AXVdTcQ=; b=N7hr8qgM/Eb0KxhqUrKkmr9qYu++TmqkARiDIHCf3Kb0wb3lzWcBd19Wl8dZ/dmoKJB/jMkCNeylAMQGepYGeOnNuRmxEvGCBW4HBdrAjv4ItLIftox1B1YLbc/KNc6+a2OkjXhhwdezHHQOzTKMwBPFwweXmbYeVMuymG+VRtY5hyjc7diFsuX7sGIFO0MFgVZN2lKjKeuEoXIHpseyOKubxkGBTKBY95SgkkWcZaViHB2lBe0Z84jd8bA0LmPlZRmRuARye7WATpcrhApSvHsSckk8xTUxCIZ6vyWQoqbR2cQ4WmxOHG3VSZ7wEXmuu6gES4A4umaDQQqV485CpA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mNmvRTN0enW9R5+nHOU0sMMi/Y9hdX6uoYuQ1xNsvv3FxSLz0ZmG/p8/1wzyXEpUxXv2SIIUi0HCNkWpH9O0TSfV/oQhErerzk9io3uMFT1WOEWX8rkNCj1yYufLg9t2Im2vVKF5+uS2hfrWZg9kkighGy03vhzIOKtmna/6iQLPegmvxRERDJtAWVWJwG4y+fS8PIXovN0bq8Nf0phenDqyxVwb70CdoK5o/KzIWKrFRz4nZ6C1mPFIGOIkrbUOPkaiU/6WpAmWY54982ygQJjQoMrfclKjPeuJy+2ufJmM5Zj6fXRMspdMjAQz5xfuTMTGFDcWs+Vya1thDB40iQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 26 Apr 2023 06:30:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHZd0ulMpqFICe/LUiDVq6+aDsW9687tFqAgAFSIKA=
- Thread-topic: [PATCH v4 09/17] xen/arm: introduce a helper to parse device tree NUMA distance map
Hi Jan,
> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Subject: Re: [PATCH v4 09/17] xen/arm: introduce a helper to parse device
> tree NUMA distance map
>
> > + distance = dt_next_cell(1, &matrix);
>
> Upon second thought I checked what dt_next_cell() returns: You're silently
> truncating here and then ...
>
> > + /* Bi-directions are not set, set both */
> > + numa_set_distance(from, to, distance);
> > + numa_set_distance(to, from, distance);
>
> ... here again. Is that really the intention?
By hunting down the historical discussions I found that using dt_next_cell() is
what Julien suggested 2 years ago in the RFC series [1]. Given the truncation
here is for node id (from/to) and distance which I am pretty sure will not
exceed 32-bit range, I think the silent truncation is safe.
However I understand your point here, the silent truncation is not ideal, so
I wonder if you have any suggestions to improve, do you think I should change
these variables to u64 or maybe I need to do the explicit type cast or any
better suggestions from you? Thanks!
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-08/msg01175.html
Kind regards,
Henry
>
> Jan
|