lkml.org 
[lkml]   [2024]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] selftests/seccomp: Pin benchmark to single CPU
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

\
 
 \ /
  Last update: 2024-05-27 14:50    [W:0.210 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site