From patchwork Mon Aug 28 03:52:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13367511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD202C83F11 for ; Mon, 28 Aug 2023 03:52:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B704A28000F; Sun, 27 Aug 2023 23:52:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B20BB8E0001; Sun, 27 Aug 2023 23:52:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0F0A28000F; Sun, 27 Aug 2023 23:52:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8F7228E0001 for ; Sun, 27 Aug 2023 23:52:54 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 99E628012E for ; Mon, 28 Aug 2023 03:52:53 +0000 (UTC) X-FDA: 81172142226.09.5856607 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf03.hostedemail.com (Postfix) with ESMTP id BD09E2000C for ; Mon, 28 Aug 2023 03:52:51 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693194772; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=vWQpHyeb69Lpm3o8je1742QlMDfMnSeOcOJ0nek6vug=; b=iESCD0VQeLM5BahggcRtc8y+E/DOWdLoZSi0+XtVQ4fBjrXFQUinnnLK9JJ+8a8IBz+exP hoTeJDn/Lmjb1WN3zr73iGNYGCmwbYfJqXudQ3ZB0CE7DvJZKhFprKgbRi/AJmd+bAeDy3 hhVlV+rXj9hCPpvk4K4kE35AQHRzczw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693194772; a=rsa-sha256; cv=none; b=6oXP/gTD38G4b5QTXp3PsxClNhxbUNHDdeCnFwlWlomDX2rHgcTHN054eA43S2pK1SWOT1 RAxdstsIHU9XsJglDqT/QUNinKekwJNLTXEubjlb8UqpTzarGZSOWTFf9YMMNaFifkC9XK 4O8vZgop1TXAnH8+ut1dwCaS9U5Q/KU= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F27722F4; Sun, 27 Aug 2023 20:53:30 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.57.227]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0CD7E3F738; Sun, 27 Aug 2023 20:52:48 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] mm/mmap: Define DEFAULT_STACK_GUARD_GAP Date: Mon, 28 Aug 2023 09:22:48 +0530 Message-Id: <20230828035248.678960-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Stat-Signature: 5afcrozdx6t1f38d8aqdk79i9iwy1nao X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BD09E2000C X-Rspam-User: X-HE-Tag: 1693194771-103212 X-HE-Meta: U2FsdGVkX1+lUB96oPAwzxt3opXovBDUEYs3rTOhZIRh4e7U0NM1a/esQF5jHiiQYBrjnpVOs/FzQjChKxbQLEZNBk3umEb9V7YdPEEC2RqUSoAGaniGJo1D4uOlzAg+3JohqmYYA8q5dxzqg009nP9tBkhJBlIls+DL8t7UMdP4IGhHhm1VPN4WsyHQa4Zk55CI22q9D1BXwxLXWR05EqF60sffzghTMF/OOnxlLLSuKQ+q9nh7qV8OSmQgORMzYb7cwMjfplAodb7eP1c3olAQPF5PicmR0kWtTi7sybgTCKvt5Z2S9WDW+ON5n59YPG4RjoHaX8XE0VJ8gLdYnsAD4bG/plws5A2STkL79vo74rloT+T6+UtVDe2wXcQOITQMbfXedxVdoPUEyYMY6t2OdwqhfjJQPv80Uyrpk9AIsS6fyLwgQL5syf2p1LDytJftMPfXiChdmN+5a9+LQHL1jyi4fJc1eKserNo9h19Z95ajjOYHL7YTd23cJJERS5mr8WBNKQRcLJ8z6RWGZbNQ4FV/YFHzbIkXEYrFB2RE8LA1vTVCgPHHnmL8XTgZWB+N9YifivbSqoGWOKjuFaaITApKDhacJAfr3wHgLP4aqnp+u3P9FsXTTJJnDabRe5jT7TMmswG8mPXA/SHLMnHNH3oluXQnCNlWKiExsaRM/WQzY7a7y5xfZE7cVgluu3m+h1sVRHusqjnPNiBEcsLDUFWT6I2SJw6C34AwaLMNH5llBjpKBUyA0wch0vPyeOjwf/vZiGtX8+Es4a/deaLziLz776yVH1nZ7KCZnGMNtO7T+zDKUrDi6bgT4rkYmFPYveV4FSpduLZaYWJQVw6VodApzJr0xPsYLnCSfkSplu6bRzuj7Y+J0wjaASvGKaVzcBlFPIWZDu/6MUk7y6NXK2qCWmuKMtSkkaXSuClPFzXcbro49Mswtdvr659kBrKsMs4Bv3HK8eD0xMD 0uTqsAzF BE3Nw2eBVeUqN+nIDk0Y/dJbAYR2g53H1lxQzBQ5PF33HkdsHeCHzrPKEnTgVq9GZo0OaB31/6kqsY4ydXrhLGcc4Q85ToSRkyehNpCOh6sEjZ4JVd8A8wET64kgpaImb8HMyepsslS112U4MmA0ld+87QCiyR+Nn4/sg3w8JBqJc+M4bxu/VCp06iX12fZrklCgc3TjQJ0lWlNHGjdHjucW/VUGLY1otj2D+ANw9twIdSxHK1xXlCtIg0FO0rhCqtvbp+pOO1y9WjHRDzjtN0V5R7LXYicJrXxJPgjFkR8es8HMjBmg/SbReLEGUygZUl7vX2F0syugDzwIuhyghmZqt62DqkQz2TOM/Rn65iX3KJ0WqXqgPdgW9OrNPTRCulHSY X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Signed-off-by: Anshuman Khandual --- 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 #include +/* 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<