[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
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |