Skip to content

Commit 75f296d

Browse files
Levin, Alexander (Sasha Levin)torvalds
authored andcommitted
kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK
Convert all allocations that used a NOTRACK flag to stop using it. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Tim Hansen <[email protected]> Cc: Vegard Nossum <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4950276 commit 75f296d

File tree

23 files changed

+36
-48
lines changed

23 files changed

+36
-48
lines changed

arch/arm/include/asm/pgalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
5757
extern pgd_t *pgd_alloc(struct mm_struct *mm);
5858
extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
5959

60-
#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
60+
#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
6161

6262
static inline void clean_pte_table(pte_t *pte)
6363
{

arch/arm64/include/asm/pgalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#define check_pgt_cache() do { } while (0)
2828

29-
#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
29+
#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
3030
#define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
3131

3232
#if CONFIG_PGTABLE_LEVELS > 2

arch/powerpc/include/asm/pgalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
1818
}
1919
#endif /* MODULE */
2020

21-
#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
21+
#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
2222

2323
#ifdef CONFIG_PPC_BOOK3S
2424
#include <asm/book3s/pgalloc.h>

arch/sh/kernel/dwarf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,11 +1172,11 @@ static int __init dwarf_unwinder_init(void)
11721172

11731173
dwarf_frame_cachep = kmem_cache_create("dwarf_frames",
11741174
sizeof(struct dwarf_frame), 0,
1175-
SLAB_PANIC | SLAB_HWCACHE_ALIGN | SLAB_NOTRACK, NULL);
1175+
SLAB_PANIC | SLAB_HWCACHE_ALIGN, NULL);
11761176

11771177
dwarf_reg_cachep = kmem_cache_create("dwarf_regs",
11781178
sizeof(struct dwarf_reg), 0,
1179-
SLAB_PANIC | SLAB_HWCACHE_ALIGN | SLAB_NOTRACK, NULL);
1179+
SLAB_PANIC | SLAB_HWCACHE_ALIGN, NULL);
11801180

11811181
dwarf_frame_pool = mempool_create_slab_pool(DWARF_FRAME_MIN_REQ,
11821182
dwarf_frame_cachep);

arch/sh/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void arch_task_cache_init(void)
5959

6060
task_xstate_cachep = kmem_cache_create("task_xstate", xstate_size,
6161
__alignof__(union thread_xstate),
62-
SLAB_PANIC | SLAB_NOTRACK, NULL);
62+
SLAB_PANIC, NULL);
6363
}
6464

6565
#ifdef CONFIG_SH_FPU_EMU

arch/sparc/mm/init_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,7 +2927,7 @@ void __flush_tlb_all(void)
29272927
pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
29282928
unsigned long address)
29292929
{
2930-
struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO);
2930+
struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
29312931
pte_t *pte = NULL;
29322932

29332933
if (page)
@@ -2939,7 +2939,7 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
29392939
pgtable_t pte_alloc_one(struct mm_struct *mm,
29402940
unsigned long address)
29412941
{
2942-
struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO);
2942+
struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
29432943
if (!page)
29442944
return NULL;
29452945
if (!pgtable_page_ctor(page)) {

arch/unicore32/include/asm/pgalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd);
2828
#define pgd_alloc(mm) get_pgd_slow(mm)
2929
#define pgd_free(mm, pgd) free_pgd_slow(mm, pgd)
3030

31-
#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
31+
#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
3232

3333
/*
3434
* Allocate one PTE table.

arch/x86/kernel/espfix_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# error "Need more virtual address space for the ESPFIX hack"
5858
#endif
5959

60-
#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
60+
#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
6161

6262
/* This contains the *bottom* address of the espfix stack */
6363
DEFINE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);

arch/x86/mm/init.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ __ref void *alloc_low_pages(unsigned int num)
9292
unsigned int order;
9393

9494
order = get_order((unsigned long)num << PAGE_SHIFT);
95-
return (void *)__get_free_pages(GFP_ATOMIC | __GFP_NOTRACK |
96-
__GFP_ZERO, order);
95+
return (void *)__get_free_pages(GFP_ATOMIC | __GFP_ZERO, order);
9796
}
9897

9998
if ((pgt_buf_end + num) > pgt_buf_top || !can_use_brk_pgt) {

arch/x86/mm/init_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static __ref void *spp_getpage(void)
184184
void *ptr;
185185

186186
if (after_bootmem)
187-
ptr = (void *) get_zeroed_page(GFP_ATOMIC | __GFP_NOTRACK);
187+
ptr = (void *) get_zeroed_page(GFP_ATOMIC);
188188
else
189189
ptr = alloc_bootmem_pages(PAGE_SIZE);
190190

0 commit comments

Comments
 (0)