[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 03/17] xen/arm: implement node distance helpers for Arm
- To: Henry Wang <Henry.Wang@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 25 Apr 2023 11:43:08 +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=3ysSWlggfX7ar5zc11t8m9pp2LqrWQ4SRh3Kl4aeuI8=; b=WsSCKU2f9c3ti0g3iCwudq97SCYVxCf/q+kNwgpP29ifptzgesvKfZ1fVqzWlRN0hPbmqIFH7YWb5f0cMfbnzcwUWghz2tE7lvWD0Cv20iXJD2NzJytE1+JHvN2y/gMQKonU8XJOXZqr9RvvF3UxS7rPw6LZHwG1EruBECv+ThyNrH5PFcTVC0x/5s7gArPVSTzxujoTfLU5EQVJbKHB+6NHnxO4ZjOtF3towQ5QqEAEiYJnVldzChkMpDB4vbVlWO7+QWetR8X62fyPXGPrs51+PbDZ/i3AGgg6VlD4kBbOmQ3v6u82KQ4yKZcaTggbyGgyziOJ2Gx+khlfC/fEww==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6TKfXiTQ6QhEqOIEwe4w4dqK7BnNQh0oN74aylur1gysVWWPtXNonkZOIAjKH3+Bggi67wsUUxcCacfm3Npgr3ocLLIK1Q/QddNDLfp6tyLd4wRYUTF+AL4GjhTLZ93mTZtL03UzelNGYJG4l4/sC47Do1jt+yr2OGN+yRH9hvSdjEB1clAm5HaZV+DgZoBY+GMVBR+EY5hzJMTqfiS2ONqu5KQ1uxaj0bT1w78zhrzBI3urZK7LK+xaj9vR5lr/Q2Hl+Ey3AQESMN4q271F2VReMrjiELN6setpJ90nIgTEVF5SzK3W2IAlzHeme9CFupkhj9+AaA8mYD0YRkm3w==
- 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: Tue, 25 Apr 2023 09:43:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 25.04.2023 11:31, Henry Wang wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> On 25.04.2023 09:56, Henry Wang wrote:
>>> + /* NUMA defines NUMA_NO_DISTANCE as unreachable and 0-9 are
>> undefined */
>>> + if ( distance >= NUMA_NO_DISTANCE || distance <=
>> NUMA_DISTANCE_UDF_MAX ||
>>> + (from == to && distance != NUMA_LOCAL_DISTANCE) )
>>> + {
>>> + printk(KERN_WARNING
>>> + "NUMA: invalid distance: from=%"PRIu8" to=%"PRIu8"
>> distance=%"PRIu32"\n",
>>> + from, to, distance);
>>> + return;
>>> + }
>>
>> I appreciate the checking that node-local references are
>> NUMA_LOCAL_DISTANCE,
>> but if they're wrongly passed into here, shouldn't the resulting array still
>> have NUMA_LOCAL_DISTANCE on its diagonal, at least as far as present nodes
>> go?
>
> Apologies in advance to ask more specific details from you as I am not sure
> if I can correctly understand the "if they're wrongly passed into here" case.
> Do you
> mean we are always guaranteed that if from == to, the distance will always be
> NUMA_LOCAL_DISTANCE so the (from == to && distance != NUMA_LOCAL_DISTANCE)
> check is redundant and can be removed? Thanks.
It's a little odd that you ask me: It is your code which insists on
NUMA_LOCAL_DISTANCE when from == to. If you insist on your caller to pass
only this one value, then I think it is only logical to also set the
respective table entries to that value (rather than leaving them at
NUMA_NO_DISTANCE).
Jan
|