From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] mmap18: Increase minimal stack mapping to 8KB
Date: Fri, 25 Sep 2020 14:34:19 +0200 [thread overview]
Message-ID: <20200925123419.GD6554@yuki.lan> (raw)
In-Reply-To: <20200924144246.12750-2-mdoucha@suse.cz>
Hi!
> The first testcase keeps segfaulting on older kernels with only 4KB initial
> stack mapping
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>
> Note: Increasing initial stack size to 8KB fixes the segfaults but I'm not
> entirely sure whether we shouldn't use PTHREAD_STACK_MIN as the minimal size
> instead. Pthread man page isn't entirely clear whether PTHREAD_STACK_MIN is
> the minimal value for stack size after it grows to the limit, or the minimal
> size of the initial stack mapping (before it starts growing).
I vote for passing down PTHREAD_STACK_MIN for the initial mapping.
> On x86_64, PTHREAD_STACK_MIN is 4 pages (16KB). On PPC64, it's 2 pages
> (128KB).
>
> testcases/kernel/syscalls/mmap/mmap18.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/mmap/mmap18.c b/testcases/kernel/syscalls/mmap/mmap18.c
> index 966bf673e..8b149fb93 100644
> --- a/testcases/kernel/syscalls/mmap/mmap18.c
> +++ b/testcases/kernel/syscalls/mmap/mmap18.c
> @@ -201,10 +201,11 @@ static void grow_stack_fail(size_t stack_size, size_t mapped_size)
> static void run_test(void)
> {
> size_t stack_size = 8 * PTHREAD_STACK_MIN;
> + size_t minsize = MAX(page_size, 8192);
>
> - grow_stack_success(stack_size, page_size);
> + grow_stack_success(stack_size, minsize);
> grow_stack_success(stack_size, stack_size/2);
> - grow_stack_fail(stack_size, page_size);
> + grow_stack_fail(stack_size, minsize);
> grow_stack_fail(stack_size, stack_size/2);
> }
>
> --
> 2.28.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2020-09-25 12:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 14:42 [LTP] [PATCH 1/2] Fix formatting signal name in tst_strstatus() Martin Doucha
2020-09-24 14:42 ` [LTP] [PATCH 2/2] mmap18: Increase minimal stack mapping to 8KB Martin Doucha
2020-09-25 10:12 ` Li Wang
2020-09-25 12:34 ` Cyril Hrubis [this message]
2020-09-25 3:20 ` [LTP] [PATCH 1/2] Fix formatting signal name in tst_strstatus() Li Wang
2020-09-25 12:24 ` Cyril Hrubis
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=20200925123419.GD6554@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.