All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Holger Dengler <dengler@linux.ibm.com>
Cc: Eric Biggers <ebiggers@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Harald Freudenberger <freude@linux.ibm.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH v1 1/1] lib/crypto: tests: Add KUnit tests for AES
Date: Fri, 16 Jan 2026 22:30:15 +0000	[thread overview]
Message-ID: <20260116223015.60887d5d@pumpkin> (raw)
In-Reply-To: <aedfebcb-4bca-4474-a590-b1acc37307ac@linux.ibm.com>

On Fri, 16 Jan 2026 21:55:04 +0100
Holger Dengler <dengler@linux.ibm.com> wrote:

> On 16/01/2026 20:44, Eric Biggers wrote:
...
> > The warm-up loops in the existing benchmarks are both for cache warming
> > and to get the CPU frequency fast and fixed.  It's not anything
> > sophisticated, but rather just something that's simple and seems to
> > works well enough across CPUs without depending on any special APIs.  If
> > your CPU doesn't do much frequency scaling, you may not notice a
> > difference, but other CPUs may need it.  
> 
> Do you have a gut feeling how many iterations it takes to get the CPU speed
> up? If it takes less than 50 iterations, it would be sufficient with the new
> method.

It may not matter what you do to get the cpu speed fixed.
Looping calling ktime_get_ns() for 'long enough' should do it.
That would be test independent but the 'long enough' very
cpu dependent.
The benchmarks probably ought to have some common API - even if it
just in the kunit code.

The advantage of counting cpu clocks is the frequency then doesn't
matter as much - L1 cache miss timings might change.

The difficulty is finding a cpu clock counter. Architecture dependent
and may not exist (you don't want the fixed frequency 'sanitised' TSC).

	David

  reply	other threads:[~2026-01-16 22:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 18:38 [PATCH v1 0/1] lib/crypto: tests: KUnit test-suite for AES Holger Dengler
2026-01-15 18:38 ` [PATCH v1 1/1] lib/crypto: tests: Add KUnit tests " Holger Dengler
2026-01-15 20:43   ` Eric Biggers
2026-01-15 21:51     ` Holger Dengler
2026-01-15 21:58       ` Eric Biggers
2026-01-15 22:05     ` David Laight
2026-01-16 17:31       ` Holger Dengler
2026-01-16 18:37         ` David Laight
2026-01-16 19:20           ` Holger Dengler
2026-01-16 19:44             ` Eric Biggers
2026-01-16 20:55               ` Holger Dengler
2026-01-16 22:30                 ` David Laight [this message]
2026-01-17 23:59                   ` Eric Biggers
2026-01-16  0:25   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-01-16 13:20 kernel test robot

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=20260116223015.60887d5d@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=dengler@linux.ibm.com \
    --cc=ebiggers@kernel.org \
    --cc=freude@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@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 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.