On 3/13/20 12:04 PM, Srikar Dronamraju wrote: >> I lost all the memory about it. :) >> Anyway, how about this? >> >> 1. make node_present_pages() safer >> static inline node_present_pages(nid) >> { >> if (!node_online(nid)) return 0; >> return (NODE_DATA(nid)->node_present_pages); >> } >> > > Yes this would help. Looks good, yeah. >> 2. make node_to_mem_node() safer for all cases >> In ppc arch's mem_topology_setup(void) >> for_each_present_cpu(cpu) { >> numa_setup_cpu(cpu); >> mem_node = node_to_mem_node(numa_mem_id()); >> if (!node_present_pages(mem_node)) { >> _node_numa_mem_[numa_mem_id()] = first_online_node; >> } >> } >> > > But here as discussed above, we miss the case of possible but not present nodes. > For such nodes, the above change may not update, resulting in they still > having 0. And node 0 can be only possible but not present. So is there other way to do the setup so that node_to_mem_node() returns an online+present node when called for any possible node?