public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Ben Kallus <benjamin.p.kallus.gr@dartmouth.edu>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH] man/man2/mmap.2: Further document MAP_GROWSDOWN
Date: Mon, 26 Jan 2026 23:35:31 +0100	[thread overview]
Message-ID: <aXfrneY9fxE1-pbQ@devuan> (raw)
In-Reply-To: <20260126181304.3312554-1-benjamin.p.kallus.gr@dartmouth.edu>

[-- Attachment #1: Type: text/plain, Size: 3093 bytes --]

Hi Ben,

On 2026-01-26T13:13:04-0500, Ben Kallus wrote:
> Makes 2 corrections to the page:
> 1. mmap(MAP_GROWSDOWN) returns the base address of the returned
>    mapping; not one page lower than that.
> 2. When growing a MAP_GROWSDOWN mapping, the kernel doesn't require that
>    the faulting access be within the guard page. Instead, it just needs
>    to be beneath the mapping, and not within `stack_guard_gap` of the
>    next lower mapping. By default, `stack_guard_gap` is 256.

Would you mind separating this into two patches?  Or do you think this
is better as a single one?

> ---

Would you mind signing the patch?

$ tail CONTRIBUTING.d/patches/description 
    Trailer
	Sign your patch with "Signed-off-by:".  Read about the
	"Developer's Certificate of Origin" at
	<https://www.kernel.org/doc/Documentation/process/submitting-patches.rst>.
	When appropriate, other tags documented in that file, such as
	"Reported-by:", "Reviewed-by:", "Acked-by:", and "Suggested-by:"
	can be added to the patch.  We use "Co-authored-by:" instead of
	"Co-developed-by:".  Example:

		Signed-off-by: Alejandro Colomar <alx@kernel.org>

>  man/man2/mmap.2 | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/man/man2/mmap.2 b/man/man2/mmap.2
> index 093b0caf1..be2b21ccc 100644
> --- a/man/man2/mmap.2
> +++ b/man/man2/mmap.2
> @@ -274,13 +274,11 @@ should check the returned address against the requested address.
>  This flag is used for stacks.
>  It indicates to the kernel virtual memory system that the mapping
>  should extend downward in memory.
> -The return address is one page lower than the memory area that is
> -actually created in the process's virtual address space.
> -Touching an address in the "guard" page below the mapping will cause
> -the mapping to grow by a page.
> -This growth can be repeated until the mapping grows to within a
> -page of the high end of the next lower mapping,
> -at which point touching the "guard" page will result in a
> +Accessing an address in the pages below the mapping will cause the mapping
> +to grow to accommodate the access.

Please use semantic newlines.  See man-pages(7).

$ MANWIDTH=72 man man-pages | awk '/Use semantic newlines/,/^$/'
   Use semantic newlines
     In the source of a manual page, new sentences should be started on
     new lines, long sentences should be split  into  lines  at  clause
     breaks  (commas,  semicolons, colons, and so on), and long clauses
     should be split at phrase boundaries.  This convention,  sometimes
     known as "semantic newlines", makes it easier to see the effect of
     patches, which often operate at the level of individual sentences,
     clauses, or phrases.


Have a lovely day!
Alex

> +This growth can be repeated until the mapping grows to within
> +256 pages of the high end of the next lower mapping, at which point touching
> +below the mapping will result in a
>  .B SIGSEGV
>  signal.
>  .TP
> -- 
> 2.52.0
> 

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-01-26 22:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 18:13 [PATCH] man/man2/mmap.2: Further document MAP_GROWSDOWN Ben Kallus
2026-01-26 22:35 ` Alejandro Colomar [this message]
2026-01-27 14:22   ` Ben Kallus

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=aXfrneY9fxE1-pbQ@devuan \
    --to=alx@kernel.org \
    --cc=benjamin.p.kallus.gr@dartmouth.edu \
    --cc=linux-man@vger.kernel.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