Re: [PATCH] cyclictest: Fix threads being affined even when -a isn't set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 28, 2022 at 7:48 AM John Kacur <jkacur@xxxxxxxxxx> wrote:
> On Tue, 26 Jul 2022, John Stultz wrote:
> > diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> > index decea78..02f32f6 100644
> > --- a/src/cyclictest/cyclictest.c
> > +++ b/src/cyclictest/cyclictest.c
> > @@ -1270,8 +1270,6 @@ static void process_options(int argc, char *argv[], int max_cpus)
> >       /* if smp wasn't requested, test for numa automatically */
> >       if (!smp) {
> >               numa = numa_initialize();
> > -             if (setaffinity == AFFINITY_UNSPECIFIED)
> > -                     setaffinity = AFFINITY_USEALL;
> >       }
> >
> >       if (option_affinity) {
> > --
> > 2.37.1.359.gd136c6c3e2-goog
> >
> >
>
> Okay, I see what's happening. We removed the numa flag to automate if
> the user doesn't specify smi, then we use numa if we detect that it is
> available and in that case we assume AFFINITY_USEALL. Part of this was an
> attempt to reduce the alphabet soup that the cyclictest commandline was
> becoming. However, I see your point, if a person doesn't ask for affinity,
> then, it shouldn't be assumed.
>
> Your patch of course doesn't work as it is, because we'll end-up passing a
> cpu=-1 value to rt_numa_numa_node_of_cpu(int cpu) resulting in
> FATAL: invalid cpu passed to numa_node_of_cpu(-1)
> but it illustrated your point.

Ah. Apologies! Interestingly I didn't see this on the device I was
testing with, but I can reproduce it on another system.

> I'm off for a few days, but I'll tackle this when I come back on.

I've got an approach that in the numa case, has a separate node_cpu
value which is normally cpu but if cpu is -1 it will use the result of
cpu_for_thread_ua(). That should at least match previous behavior with
regards to the numa allocation logic.

I'll send that out in a second here and you can take or tweak it as
you feel best when you're back.

thanks
-john



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux