ASoC: SOF: debug: use pm_runtime_resume_and_get()
[linux-2.6-microblaze.git] / mm / mprotect.c
index 2887644..b69ce7a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/uaccess.h>
 #include <linux/mm_inline.h>
 #include <linux/pgtable.h>
+#include <linux/sched/sysctl.h>
 #include <asm/cacheflush.h>
 #include <asm/mmu_context.h>
 #include <asm/tlbflush.h>
@@ -83,6 +84,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
                         */
                        if (prot_numa) {
                                struct page *page;
+                               int nid;
 
                                /* Avoid TLB flush if possible */
                                if (pte_protnone(oldpte))
@@ -109,7 +111,16 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
                                 * Don't mess with PTEs if page is already on the node
                                 * a single-threaded process is running on.
                                 */
-                               if (target_node == page_to_nid(page))
+                               nid = page_to_nid(page);
+                               if (target_node == nid)
+                                       continue;
+
+                               /*
+                                * Skip scanning top tier node if normal numa
+                                * balancing is disabled
+                                */
+                               if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_NORMAL) &&
+                                   node_is_toptier(nid))
                                        continue;
                        }