These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / arch / ia64 / mm / numa.c
index ea21d4c..aa19b7a 100644 (file)
@@ -58,27 +58,22 @@ paddr_to_nid(unsigned long paddr)
  * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where
  * the section resides.
  */
-int __meminit __early_pfn_to_nid(unsigned long pfn)
+int __meminit __early_pfn_to_nid(unsigned long pfn,
+                                       struct mminit_pfnnid_cache *state)
 {
        int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec;
-       /*
-        * NOTE: The following SMP-unsafe globals are only used early in boot
-        * when the kernel is running single-threaded.
-        */
-       static int __meminitdata last_ssec, last_esec;
-       static int __meminitdata last_nid;
 
-       if (section >= last_ssec && section < last_esec)
-               return last_nid;
+       if (section >= state->last_start && section < state->last_end)
+               return state->last_nid;
 
        for (i = 0; i < num_node_memblks; i++) {
                ssec = node_memblk[i].start_paddr >> PA_SECTION_SHIFT;
                esec = (node_memblk[i].start_paddr + node_memblk[i].size +
                        ((1L << PA_SECTION_SHIFT) - 1)) >> PA_SECTION_SHIFT;
                if (section >= ssec && section < esec) {
-                       last_ssec = ssec;
-                       last_esec = esec;
-                       last_nid = node_memblk[i].nid;
+                       state->last_start = ssec;
+                       state->last_end = esec;
+                       state->last_nid = node_memblk[i].nid;
                        return node_memblk[i].nid;
                }
        }