mempolicy: fix a race in shared_policy_replace()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / mempolicy.h
index 95b738c7abff9ac1e45a5e78e1daf1437b2283fd..cec56932560823ac6a34ce5c5c21bea24316a9ea 100644 (file)
@@ -188,7 +188,7 @@ struct sp_node {
 
 struct shared_policy {
        struct rb_root root;
-       spinlock_t lock;
+       struct mutex mutex;
 };
 
 void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol);
@@ -239,7 +239,7 @@ extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
 /* Check if a vma is migratable */
 static inline int vma_migratable(struct vm_area_struct *vma)
 {
-       if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
+       if (vma->vm_flags & (VM_IO | VM_HUGETLB | VM_PFNMAP))
                return 0;
        /*
         * Migration allocates pages in the highest zone. If we cannot