diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/Kconfig | 2 | ||||
-rw-r--r-- | mm/memory.c | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/mm/Kconfig b/mm/Kconfig index 7aa02def4666..de31af256207 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -218,8 +218,6 @@ config SPLIT_PTLOCK_CPUS | |||
218 | int | 218 | int |
219 | default "999999" if ARM && !CPU_CACHE_VIPT | 219 | default "999999" if ARM && !CPU_CACHE_VIPT |
220 | default "999999" if PARISC && !PA20 | 220 | default "999999" if PARISC && !PA20 |
221 | default "999999" if DEBUG_SPINLOCK || DEBUG_LOCK_ALLOC | ||
222 | default "999999" if !64BIT && GENERIC_LOCKBREAK | ||
223 | default "4" | 221 | default "4" |
224 | 222 | ||
225 | config ARCH_ENABLE_SPLIT_PMD_PTLOCK | 223 | config ARCH_ENABLE_SPLIT_PMD_PTLOCK |
diff --git a/mm/memory.c b/mm/memory.c index d05c6b10e926..24ffae2a530e 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -4270,3 +4270,22 @@ void copy_user_huge_page(struct page *dst, struct page *src, | |||
4270 | } | 4270 | } |
4271 | } | 4271 | } |
4272 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ | 4272 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ |
4273 | |||
4274 | #if USE_SPLIT_PTE_PTLOCKS | ||
4275 | bool __ptlock_alloc(struct page *page) | ||
4276 | { | ||
4277 | spinlock_t *ptl; | ||
4278 | |||
4279 | ptl = kmalloc(sizeof(spinlock_t), GFP_KERNEL); | ||
4280 | if (!ptl) | ||
4281 | return false; | ||
4282 | page->ptl = (unsigned long)ptl; | ||
4283 | return true; | ||
4284 | } | ||
4285 | |||
4286 | void __ptlock_free(struct page *page) | ||
4287 | { | ||
4288 | if (sizeof(spinlock_t) > sizeof(page->ptl)) | ||
4289 | kfree((spinlock_t *)page->ptl); | ||
4290 | } | ||
4291 | #endif | ||