From: Kees Cook <keescook@chromium.org>
To: Mark Brown <broonie@kernel.org>
Cc: kernel test robot <oliver.sang@intel.com>,
Andy Lutomirski <luto@amacapital.net>,
Will Drewry <wad@chromium.org>, Shuah Khan <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] selftests/seccomp: Pin benchmark to single CPU
Date: Tue, 6 Feb 2024 03:04:32 -0800 [thread overview]
Message-ID: <202402060302.C9BD99F@keescook> (raw)
In-Reply-To: <ZcIG8y0U1VyMsCAD@finisterre.sirena.org.uk>
On Tue, Feb 06, 2024 at 10:16:19AM +0000, Mark Brown wrote:
> On Tue, Feb 06, 2024 at 01:56:47AM -0800, Kees Cook wrote:
>
> > + /* Set from highest CPU down. */
> > + for (cpu = ncores - 1; cpu >= 0; cpu--) {
> > + CPU_ZERO_S(setsz, setp);
> > + CPU_SET_S(cpu, setsz, setp);
>
> Is there some particular reason to go from the highest CPU number down?
> Not that it super matters but the default would be to iterate from 0 and
> there's a comment but it just says the what not the why.
I was arbitrarily picking a direction and all the examples I could find
started at 0, so this would be more (?) out of the way. :P
Without a cpu cgroup, I can't _exclude_ the pinned CPU from other
processes, so I was pretending the last CPU will be less likely to be
used.
--
Kees Cook
next prev parent reply other threads:[~2024-02-06 11:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 9:56 Kees Cook
2024-02-06 10:16 ` Mark Brown
2024-02-06 11:04 ` Kees Cook [this message]
2024-02-06 11:10 ` Mark Brown
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=202402060302.C9BD99F@keescook \
--to=keescook@chromium.org \
--cc=broonie@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=oliver.sang@intel.com \
--cc=shuah@kernel.org \
--cc=wad@chromium.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
all inboxes | Powered by JetHome®