mm/vma: make is_vma_temporary_stack() available for general use
Currently the declaration and definition for is_vma_temporary_stack() are scattered. Lets make is_vma_temporary_stack() helper available for general use and also drop the declaration from (include/linux/huge_mm.h) which is no longer required. While at this, rename this as vma_is_temporary_stack() in line with existing helpers. This should not cause any functional change. Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Ingo Molnar <mingo@redhat.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Mackerras <paulus@samba.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1582782965-3274-4-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Juhyung Park <qkrwngud825@gmail.com> Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com> fix mm/vma: make is_vma_temporary_stack() available for general use Change-Id: I8d61e2ee732ccf23057dcea24cee08514a4f00d6 Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
parent
5459270f44
commit
9afaeff153
@ -87,8 +87,6 @@ extern struct kobj_attribute shmem_enabled_attr;
|
||||
#define HPAGE_PUD_SIZE ((1UL) << HPAGE_PUD_SHIFT)
|
||||
#define HPAGE_PUD_MASK (~(HPAGE_PUD_SIZE - 1))
|
||||
|
||||
extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
|
||||
|
||||
extern unsigned long transparent_hugepage_flags;
|
||||
|
||||
/*
|
||||
@ -100,7 +98,7 @@ static inline bool __transparent_hugepage_enabled(struct vm_area_struct *vma)
|
||||
if (vma->vm_flags & VM_NOHUGEPAGE)
|
||||
return false;
|
||||
|
||||
if (is_vma_temporary_stack(vma))
|
||||
if (vma_is_temporary_stack(vma))
|
||||
return false;
|
||||
|
||||
if (test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))
|
||||
|
@ -1641,6 +1641,20 @@ static inline bool vma_is_foreign(struct vm_area_struct *vma)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool vma_is_temporary_stack(struct vm_area_struct *vma)
|
||||
{
|
||||
int maybe_stack = vma->vm_flags & (VM_GROWSDOWN | VM_GROWSUP);
|
||||
|
||||
if (!maybe_stack)
|
||||
return false;
|
||||
|
||||
if ((vma->vm_flags & VM_STACK_INCOMPLETE_SETUP) ==
|
||||
VM_STACK_INCOMPLETE_SETUP)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SHMEM
|
||||
/*
|
||||
* The vma_is_shmem is not inline because it is used only by slow
|
||||
|
@ -413,7 +413,7 @@ static bool hugepage_vma_check(struct vm_area_struct *vma,
|
||||
}
|
||||
if (!vma->anon_vma || vma->vm_ops)
|
||||
return false;
|
||||
if (is_vma_temporary_stack(vma))
|
||||
if (vma_is_temporary_stack(vma))
|
||||
return false;
|
||||
return !(vm_flags & VM_NO_KHUGEPAGED);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
|
||||
* such races:
|
||||
*
|
||||
* - During exec() shift_arg_pages(), we use a specially tagged vma
|
||||
* which rmap call sites look for using is_vma_temporary_stack().
|
||||
* which rmap call sites look for using vma_is_temporary_stack().
|
||||
*
|
||||
* - During mremap(), new_vma is often known to be placed after vma
|
||||
* in rmap traversal order. This ensures rmap will always observe
|
||||
|
16
mm/rmap.c
16
mm/rmap.c
@ -1706,23 +1706,9 @@ discard:
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool is_vma_temporary_stack(struct vm_area_struct *vma)
|
||||
{
|
||||
int maybe_stack = vma->vm_flags & (VM_GROWSDOWN | VM_GROWSUP);
|
||||
|
||||
if (!maybe_stack)
|
||||
return false;
|
||||
|
||||
if ((vma->vm_flags & VM_STACK_INCOMPLETE_SETUP) ==
|
||||
VM_STACK_INCOMPLETE_SETUP)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool invalid_migration_vma(struct vm_area_struct *vma, void *arg)
|
||||
{
|
||||
return is_vma_temporary_stack(vma);
|
||||
return vma_is_temporary_stack(vma);
|
||||
}
|
||||
|
||||
static int page_not_mapped(struct page *page)
|
||||
|
Loading…
Reference in New Issue
Block a user