From: Cyril Hrubis <chrubis@suse.cz>
To: Samir Mulani <samir@linux.vnet.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] Migrating the libhugetlbfs/testcases/stack_grow_into_huge.c test
Date: Wed, 4 Sep 2024 11:49:11 +0200 [thread overview]
Message-ID: <ZtgtFz04EXwhtIGb@yuki.lan> (raw)
In-Reply-To: <20240816103317.127972-1-samir@linux.vnet.ibm.com>
Hi!
> + /*\
> + * [Description]
> + *
> + * Test Name: stack_grow_into_huge
Drop the test name please, it has no value in the description.
> + * On PowerPC, the address space is divided into segments. These segments can
> + * contain either huge pages or normal pages, but not both. All segments are
> + * initially set up to map normal pages. When a huge page mapping is created
> + * within a set of empty segments, they are "enabled" for huge pages at that
> + * time. Once enabled for huge pages, they can not be used again for normal
> + * pages for the remaining lifetime of the process.
> + *
> + * If the segment immediately preceeding the segment containing the stack is
> + * converted to huge pages and the stack is made to grow into the this
> + * preceeding segment, some kernels may attempt to map normal pages into the
> + * huge page-only segment -- resulting in bugs.
> + */
> +
> +#include "hugetlb.h"
> +#include <errno.h>
> +
> +#ifdef __LP64__
> +#define STACK_ALLOCATION_SIZE (256*1024*1024)
> +#else
> +#define STACK_ALLOCATION_SIZE (16*1024*1024)
> +#endif
> +#define PALIGN(p, a) ((void *)LTP_ALIGN((unsigned long)(p), (a)))
> +#define MNTPOINT "hugetlbfs/"
> +static int fd = -1;
> +static unsigned long long hpage_size;
> +static int page_size;
> +
> +
> +void do_child(void *stop_address)
> +{
> + struct rlimit r;
> + volatile int *x;
> +
> + /* corefile from this process is not interesting and limiting
> + * its size can save a lot of time. '1' is a special value,
> + * that will also abort dumping via pipe, which by default
> + * sets limit to RLIM_INFINITY.
> + */
> + r.rlim_cur = 1;
> + r.rlim_max = 1;
> + SAFE_SETRLIMIT(RLIMIT_CORE, &r);
We have a library function tst_no_corefile() exactly for this purpose,
please use that one instead.
The rest looks good. You can add my Reviewed-by: Cyril Hrubis
<chrubis@suse.cz> with these minor changes added.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2024-09-04 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 10:33 [LTP] [PATCH v4] Migrating the libhugetlbfs/testcases/stack_grow_into_huge.c test Samir Mulani
2024-09-04 9:49 ` Cyril Hrubis [this message]
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=ZtgtFz04EXwhtIGb@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=samir@linux.vnet.ibm.com \
/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