Re: [Question] report a race condition between CPU hotplug state machine and hrtimer 'sched_cfs_period_timer' for cfs bandwidth throttling

From: Thomas Gleixner
Date: Wed Jun 28 2023 - 17:12:45 EST


On Wed, Jun 28 2023 at 15:30, Vincent Guittot wrote:
> On Tue, 27 Jun 2023 at 18:46, Vincent Guittot
>> > > + struct hrtimer_clock_base *clock_base = cfs_b->period_timer.base;
>> > > + int cpu = clock_base->cpu_base->cpu;
>> > > + if (!cpu_active(cpu) && cpu != smp_processor_id())
>> > > + hrtimer_start_expires(&cfs_b->period_timer,
>> > > HRTIMER_MODE_ABS_PINNED);
>> > > return;
>> > > + }

Can you please trim your replies?

>> I have been able to reproduce your problem and run your fix on top. I
>> still wonder if there is a
>
> Looks like I have been preempted and never finished the sentence. The
> full sentence is:
> I still wonder if there is a race condition where the hang can still
> happen but i haven't been able to find one so far

As I explained before. Assume the timer fires on the outgoing CPU and
the other CPU tries to rearm it concurrently. It will stay on the
outgoing CPU and not move over.

Thanks,

tglx