aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 24ffae2a530e..5d9025f3b3e1 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4271,21 +4271,20 @@ void copy_user_huge_page(struct page *dst, struct page *src,
4271} 4271}
4272#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ 4272#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
4273 4273
4274#if USE_SPLIT_PTE_PTLOCKS 4274#if USE_SPLIT_PTE_PTLOCKS && BLOATED_SPINLOCKS
4275bool __ptlock_alloc(struct page *page) 4275bool ptlock_alloc(struct page *page)
4276{ 4276{
4277 spinlock_t *ptl; 4277 spinlock_t *ptl;
4278 4278
4279 ptl = kmalloc(sizeof(spinlock_t), GFP_KERNEL); 4279 ptl = kmalloc(sizeof(spinlock_t), GFP_KERNEL);
4280 if (!ptl) 4280 if (!ptl)
4281 return false; 4281 return false;
4282 page->ptl = (unsigned long)ptl; 4282 page->ptl = ptl;
4283 return true; 4283 return true;
4284} 4284}
4285 4285
4286void __ptlock_free(struct page *page) 4286void ptlock_free(struct page *page)
4287{ 4287{
4288 if (sizeof(spinlock_t) > sizeof(page->ptl)) 4288 kfree(page->ptl);
4289 kfree((spinlock_t *)page->ptl);
4290} 4289}
4291#endif 4290#endif