public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Noah Goldstein <goldstein.w.n@gmail.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Benchtests: Improve large memcpy/memset benchmarks
Date: Thu, 23 Mar 2023 23:01:26 +0000	[thread overview]
Message-ID: <PAWPR08MB898250F97282B1772DB9A25F83879@PAWPR08MB8982.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <CAFUsyf+SqTQ7sEw5Z1FeAZv_nphQA_GYFQTBag8MqLW+8UJ9WA@mail.gmail.com>

Hi Noah,


>> -  align &= 63;
>
> Can you replace with `align &= getpagesize () - 1`?

Yes that would make more sense indeed.

>> -  if ((align + len) * sizeof (CHAR) > page_size)
>> -    return;
>
> Is there a reason to remove the out of bounds check?

Well it can't ever go out of bounds. The allocated buffer size is
2 * page_size (ie. 4 times real page size or 2 times MIN_PAGE_SIZE
due to the incorrect logic in init_sizes).

And if it could go out of bounds it should be an assert so we don't
silently benchmark a bounds check!

>>    align2 &= 4095;
>
> Might as well fix these up, can you replace 4095 with `getpagesize () - 1`?

Sure.

>> +  size_t i, iters = (MIN_PAGE_SIZE * 64) / n;
>
> this takes [.5, 10] seconds?

Yes, it's only 1 GB written per test. It takes ~8.5 seconds on an old slow
Cortex-A72.

Cheers,
Wilco



  reply	other threads:[~2023-03-23 23:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 11:41 Wilco Dijkstra
2023-03-23 18:17 ` Noah Goldstein
2023-03-23 23:01   ` Wilco Dijkstra [this message]
2023-03-24 16:29     ` Noah Goldstein
2024-03-18 15:08 Wilco Dijkstra
2024-03-18 19:29 ` Noah Goldstein
2024-03-18 19:34   ` Noah Goldstein
2024-03-27 17:02     ` Wilco Dijkstra
2024-03-28 19:28       ` Noah Goldstein

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=PAWPR08MB898250F97282B1772DB9A25F83879@PAWPR08MB8982.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=goldstein.w.n@gmail.com \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).