lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 03/15] mshyperv: Introduce numa_node_to_proximity_domain_info
From
On 8/17/23 17:17, Nuno Das Neves wrote:
>>> + if (node != NUMA_NO_NODE) {
>>> + proximity_domain_info.domain_id = node_to_pxm(node);
>>> + proximity_domain_info.flags.reserved = 0;
>>> + proximity_domain_info.flags.proximity_info_valid = 1;
>>> + proximity_domain_info.flags.proximity_preferred = 1;
>>> + } else {
>>> + proximity_domain_info.as_uint64 = 0;
>>> + }
>>> +
>>> + return proximity_domain_info;
>>> +}
>> Pop quiz: What are the rules for the 30 bits of uninitialized data of
>> proximity_domain_info.flags in the (node != NUMA_NO_NODE) case?
>>
>> I actually don't know off the top of my head. I generally avoid
>> bitfields, but if they were normal stack-allocated variable space,
>> they'd be garbage.
> I'm not sure what you are getting at here - all the fields are
> initialized.

Whoops, I somehow missed the reserved field initialization. But, yeah,
a struct would be nice instead of the union here.

\
 
 \ /
  Last update: 2023-08-18 02:27    [W:0.049 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site