summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-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,
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
-#if USE_SPLIT_PTE_PTLOCKS
-bool __ptlock_alloc(struct page *page)
+#if USE_SPLIT_PTE_PTLOCKS && BLOATED_SPINLOCKS
+bool ptlock_alloc(struct page *page)
{
spinlock_t *ptl;
ptl = kmalloc(sizeof(spinlock_t), GFP_KERNEL);
if (!ptl)
return false;
- page->ptl = (unsigned long)ptl;
+ page->ptl = ptl;
return true;
}
-void __ptlock_free(struct page *page)
+void ptlock_free(struct page *page)
{
- if (sizeof(spinlock_t) > sizeof(page->ptl))
- kfree((spinlock_t *)page->ptl);
+ kfree(page->ptl);
}
#endif