aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKalimochoAz <calimochoazucarado@gmail.com>2012-10-14 21:11:17 +0200
committerKalimochoAz <calimochoazucarado@gmail.com>2012-10-14 21:11:17 +0200
commit08c142dc92ac8075a74ffd41c7d0fff0d135ba45 (patch)
tree5fec9becb3a5b9653510d5ab63ac317330afb7c7 /mm
parent123dc2ce092ee26ac57c2b3962aeb8ed9b367fb6 (diff)
parent776a41b87e94f6942793c3268a49809a6691e4e2 (diff)
downloadkernel_samsung_crespo-08c142dc92ac8075a74ffd41c7d0fff0d135ba45.zip
kernel_samsung_crespo-08c142dc92ac8075a74ffd41c7d0fff0d135ba45.tar.gz
kernel_samsung_crespo-08c142dc92ac8075a74ffd41c7d0fff0d135ba45.tar.bz2
Merge commit '776a41b' into HEAD
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 6a569cc..5dce7d4 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1511,8 +1511,18 @@ struct mempolicy *get_vma_policy(struct task_struct *task,
addr);
if (vpol)
pol = vpol;
- } else if (vma->vm_policy)
+ } else if (vma->vm_policy) {
pol = vma->vm_policy;
+
+ /*
+ * shmem_alloc_page() passes MPOL_F_SHARED policy with
+ * a pseudo vma whose vma->vm_ops=NULL. Take a reference
+ * count on these policies which will be dropped by
+ * mpol_cond_put() later
+ */
+ if (mpol_needs_cond_ref(pol))
+ mpol_get(pol);
+ }
}
if (!pol)
pol = &default_policy;