The patch titled Subject: mm: introduce vma_is_stack() and vma_is_heap() has been added to the -mm mm-unstable branch. Its filename is mm-introduce-vma_is_stack-and-vma_is_heap.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-introduce-vma_is_stack-and-vma_is_heap.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Subject: mm: introduce vma_is_stack() and vma_is_heap() Date: Wed, 12 Jul 2023 22:38:27 +0800 Patch series "mm: convert to vma_is_heap/stack()". Add vma_is_stack() and vma_is_heap() helper and use them to simplify code. This patch (of 5): Introduce the two helpers for general use. Link: https://lkml.kernel.org/r/20230712143831.120701-1-wangkefeng.wang@xxxxxxxxxx Link: https://lkml.kernel.org/r/20230712143831.120701-2-wangkefeng.wang@xxxxxxxxxx Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Cc: Alex Deucher <alexander.deucher@xxxxxxx> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> Cc: "Christian König" <christian.koenig@xxxxxxx> Cc: Daniel Vetter <daniel@xxxxxxxx> Cc: David Airlie <airlied@xxxxxxxxx> Cc: Eric Paris <eparis@xxxxxxxxxxxxxx> Cc: Felix Kuehling <Felix.Kuehling@xxxxxxx> Cc: "Pan, Xinhui" <Xinhui.Pan@xxxxxxx> Cc: Paul Moore <paul@xxxxxxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Stephen Smalley <stephen.smalley.work@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/mm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/include/linux/mm.h~mm-introduce-vma_is_stack-and-vma_is_heap +++ a/include/linux/mm.h @@ -842,6 +842,18 @@ static inline bool vma_is_anonymous(stru return !vma->vm_ops; } +static inline bool vma_is_heap(struct vm_area_struct *vma) +{ + return vma->vm_start <= vma->vm_mm->brk && + vma->vm_end >= vma->vm_mm->start_brk; +} + +static inline bool vma_is_stack(struct vm_area_struct *vma) +{ + return vma->vm_start <= vma->vm_mm->start_stack && + vma->vm_end >= vma->vm_mm->start_stack; +} + static inline bool vma_is_temporary_stack(struct vm_area_struct *vma) { int maybe_stack = vma->vm_flags & (VM_GROWSDOWN | VM_GROWSUP); _ Patches currently in -mm which might be from wangkefeng.wang@xxxxxxxxxx are mm-remove-arguments-of-show_mem.patch mm-make-show_free_areas-static.patch mm-introduce-vma_is_stack-and-vma_is_heap.patch mm-use-vma_is_stack-and-vma_is_heap.patch drm-amdkfd-use-vma_is_stack-and-vma_is_heap.patch selinux-use-vma_is_stack-and-vma_is_heap.patch perf-core-use-vma_is_stack-and-vma_is_heap.patch