tools headers UAPI: Sync linux/prctl.h with the kernel sources
[linux-2.6-microblaze.git] / mm / mempolicy.c
index cd02955..d79fa29 100644 (file)
@@ -330,7 +330,7 @@ static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
        else if (pol->flags & MPOL_F_RELATIVE_NODES)
                mpol_relative_nodemask(&tmp, &pol->w.user_nodemask, nodes);
        else {
-               nodes_remap(tmp, pol->v.nodes,pol->w.cpuset_mems_allowed,
+               nodes_remap(tmp, pol->v.nodes, pol->w.cpuset_mems_allowed,
                                                                *nodes);
                pol->w.cpuset_mems_allowed = *nodes;
        }
@@ -994,7 +994,7 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask,
                if (flags & MPOL_F_ADDR) {
                        /*
                         * Take a refcount on the mpol, lookup_node()
-                        * wil drop the mmap_lock, so after calling
+                        * will drop the mmap_lock, so after calling
                         * lookup_node() only "pol" remains valid, "vma"
                         * is stale.
                         */
@@ -1124,7 +1124,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
        int err = 0;
        nodemask_t tmp;
 
-       migrate_prep();
+       lru_cache_disable();
 
        mmap_read_lock(mm);
 
@@ -1161,7 +1161,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
 
        tmp = *from;
        while (!nodes_empty(tmp)) {
-               int s,d;
+               int s, d;
                int source = NUMA_NO_NODE;
                int dest = 0;
 
@@ -1208,6 +1208,8 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
                        break;
        }
        mmap_read_unlock(mm);
+
+       lru_cache_enable();
        if (err < 0)
                return err;
        return busy;
@@ -1323,7 +1325,7 @@ static long do_mbind(unsigned long start, unsigned long len,
 
        if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
 
-               migrate_prep();
+               lru_cache_disable();
        }
        {
                NODEMASK_SCRATCH(scratch);
@@ -1371,6 +1373,8 @@ up_out:
        mmap_write_unlock(mm);
 mpol_out:
        mpol_put(new);
+       if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
+               lru_cache_enable();
        return err;
 }
 
@@ -1863,7 +1867,7 @@ static int apply_policy_zone(struct mempolicy *policy, enum zone_type zone)
         * we apply policy when gfp_zone(gfp) = ZONE_MOVABLE only.
         *
         * policy->v.nodes is intersect with node_states[N_MEMORY].
-        * so if the following test faile, it implies
+        * so if the following test fails, it implies
         * policy->v.nodes has movable memory only.
         */
        if (!nodes_intersects(policy->v.nodes, node_states[N_HIGH_MEMORY]))
@@ -2094,7 +2098,7 @@ bool init_nodemask_of_mempolicy(nodemask_t *mask)
  *
  * If tsk's mempolicy is "default" [NULL], return 'true' to indicate default
  * policy.  Otherwise, check for intersection between mask and the policy
- * nodemask for 'bind' or 'interleave' policy.  For 'perferred' or 'local'
+ * nodemask for 'bind' or 'interleave' policy.  For 'preferred' or 'local'
  * policy, always return true since it may allocate elsewhere on fallback.
  *
  * Takes task_lock(tsk) to prevent freeing of its mempolicy.