Skip to content

Commit 8b2e9b7

Browse files
committed
Revert "mm: create a separate slab for page->ptl allocation"
This reverts commit ea1e7ed. Al points out that while the commit *does* actually create a separate slab for the page->ptl allocation, that slab is never actually used, and the code continues to use kmalloc/kfree. Damien Wyart points out that the original patch did have the conversion to use kmem_cache_alloc/free, so it got lost somewhere on its way to me. Revert the half-arsed attempt that didn't do anything. If we really do want the special slab (remember: this is all relevant just for debug builds, so it's not necessarily all that critical) we might as well redo the patch fully. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Andrew Morton <akpm@linux-foundation.org> Cc: Kirill A Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b5898cd commit 8b2e9b7

3 files changed

Lines changed: 1 addition & 17 deletions

File tree

‎include/linux/mm.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,6 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
13181318

13191319
#if USE_SPLIT_PTE_PTLOCKS
13201320
#if BLOATED_SPINLOCKS
1321-
void __init ptlock_cache_init(void);
13221321
extern bool ptlock_alloc(struct page *page);
13231322
extern void ptlock_free(struct page *page);
13241323

@@ -1327,7 +1326,6 @@ static inline spinlock_t *ptlock_ptr(struct page *page)
13271326
return page->ptl;
13281327
}
13291328
#else /* BLOATED_SPINLOCKS */
1330-
static inline void ptlock_cache_init(void) {}
13311329
static inline bool ptlock_alloc(struct page *page)
13321330
{
13331331
return true;
@@ -1380,17 +1378,10 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
13801378
{
13811379
return &mm->page_table_lock;
13821380
}
1383-
static inline void ptlock_cache_init(void) {}
13841381
static inline bool ptlock_init(struct page *page) { return true; }
13851382
static inline void pte_lock_deinit(struct page *page) {}
13861383
#endif /* USE_SPLIT_PTE_PTLOCKS */
13871384

1388-
static inline void pgtable_init(void)
1389-
{
1390-
ptlock_cache_init();
1391-
pgtable_cache_init();
1392-
}
1393-
13941385
static inline bool pgtable_page_ctor(struct page *page)
13951386
{
13961387
inc_zone_page_state(page, NR_PAGETABLE);

‎init/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static void __init mm_init(void)
476476
mem_init();
477477
kmem_cache_init();
478478
percpu_init_late();
479-
pgtable_init();
479+
pgtable_cache_init();
480480
vmalloc_init();
481481
}
482482

‎mm/memory.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,13 +4272,6 @@ void copy_user_huge_page(struct page *dst, struct page *src,
42724272
#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
42734273

42744274
#if USE_SPLIT_PTE_PTLOCKS && BLOATED_SPINLOCKS
4275-
static struct kmem_cache *page_ptl_cachep;
4276-
void __init ptlock_cache_init(void)
4277-
{
4278-
page_ptl_cachep = kmem_cache_create("page->ptl", sizeof(spinlock_t), 0,
4279-
SLAB_PANIC, NULL);
4280-
}
4281-
42824275
bool ptlock_alloc(struct page *page)
42834276
{
42844277
spinlock_t *ptl;

0 commit comments

Comments
 (0)