From: Anshuman Khandual <anshuman.khandual@arm.com>
To: linux-mm@kvack.org
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] mm/mmap: Define DEFAULT_STACK_GUARD_GAP
Date: Mon, 28 Aug 2023 09:22:48 +0530 [thread overview]
Message-ID: <20230828035248.678960-1-anshuman.khandual@arm.com> (raw)
This just defines a macro constant i.e DEFAULT_STACK_GUARD_GAP representing
the default gap, guarding the stack mapping. This does not cause functional
changes.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
include/linux/mman.h | 3 +++
mm/mmap.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/mman.h b/include/linux/mman.h
index cee1e4b566d8..cbcd20a071c0 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -8,6 +8,9 @@
#include <linux/atomic.h>
#include <uapi/linux/mman.h>
+/* Default gap for stack mapping is 256 pages */
+#define DEFAULT_STACK_GUARD_GAP (256UL << PAGE_SHIFT)
+
/*
* Arrange for legacy / undefined architecture specific flags to be
* ignored by mmap handling code.
diff --git a/mm/mmap.c b/mm/mmap.c
index 3937479d0e07..8679750333bb 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2120,7 +2120,7 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address)
}
/* enforced gap between the expanding stack and other mappings. */
-unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT;
+unsigned long stack_guard_gap = DEFAULT_STACK_GUARD_GAP;
static int __init cmdline_parse_stack_guard_gap(char *p)
{
--
2.30.2
next reply other threads:[~2023-08-28 3:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 3:52 Anshuman Khandual [this message]
2023-08-29 12:32 ` Matthew Wilcox
2023-08-30 2:55 ` Anshuman Khandual
2023-08-30 3:24 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230828035248.678960-1-anshuman.khandual@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox