From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Tulio Magno Quites Machado Filho <tuliom@ascii.art.br>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3] String: Ensure 'MIN_PAGE_SIZE' is multiple of 'getpagesize'
Date: Wed, 9 Feb 2022 14:48:19 -0600 [thread overview]
Message-ID: <CAFUsyfJXdSfOWgj5yxB-JhFFSS4QPp4HzUCRrfoU0dumGKEDDA@mail.gmail.com> (raw)
In-Reply-To: <87zgn0ta63.fsf@linux.ibm.com>
On Wed, Feb 9, 2022 at 7:57 AM Tulio Magno Quites Machado Filho
<tuliom@ascii.art.br> wrote:
>
> Noah Goldstein via Libc-alpha <libc-alpha@sourceware.org> writes:
>
> > When 'TEST_LEN' was defined as (4096 * 3) the allocation size Would
> > not be a multiple of system page size if system page size > 4096.
> > ---
> > string/test-strcmp.c | 14 +++++++-------
> > string/test-strncmp.c | 18 +++++++++---------
> > 2 files changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/string/test-strcmp.c b/string/test-strcmp.c
> > index eacbdc8857..0abce769d0 100644
> > --- a/string/test-strcmp.c
> > +++ b/string/test-strcmp.c
> > @@ -16,7 +16,7 @@
> > License along with the GNU C Library; if not, see
> > <https://www.gnu.org/licenses/>. */
> >
> > -#define TEST_LEN (4096 * 3)
> > +#define TEST_LEN (getpagesize () * 3)
> > #define MIN_PAGE_SIZE (TEST_LEN + 2 * getpagesize ())
> >
> > #define TEST_MAIN
> > @@ -393,7 +393,7 @@ int
> > test_main (void)
> > {
> > size_t i, j;
> > -
> > + const size_t test_len = MIN(TEST_LEN, 3 * 4096);
>
> I didn't understand this part.
> Is the intention here to protect against platforms with a page size less than
> 4096?
Both to protect against platforms with smaller page size and keep
test duration manageable for systems with larger page size.
>
> --
> Tulio Magno
next prev parent reply other threads:[~2022-02-09 20:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 20:16 [PATCH v1] String: Ensure 'MIN_PAGE_SIZE' is factor " Noah Goldstein
2022-02-07 21:10 ` Andreas Schwab
2022-02-07 21:42 ` Noah Goldstein
2022-02-07 21:41 ` [PATCH v2] String: Ensure 'MIN_PAGE_SIZE' is multiple " Noah Goldstein
2022-02-08 13:14 ` Matheus Castanho
2022-02-08 21:25 ` Noah Goldstein
2022-02-08 21:24 ` [PATCH v3] " Noah Goldstein
2022-02-09 13:57 ` Tulio Magno Quites Machado Filho
2022-02-09 20:48 ` Noah Goldstein [this message]
2022-02-10 14:05 ` Tulio Magno Quites Machado Filho
2022-02-10 14:01 ` Matheus Castanho
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=CAFUsyfJXdSfOWgj5yxB-JhFFSS4QPp4HzUCRrfoU0dumGKEDDA@mail.gmail.com \
--to=goldstein.w.n@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=tuliom@ascii.art.br \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).