Re: RT_GROUP_SCHED throttling blocks unthrottled RT tasks?

From: Joel Fernandes
Date: Fri Nov 05 2021 - 19:10:41 EST


On Fri, Nov 5, 2021 at 7:05 PM Joel Fernandes <joelaf@xxxxxxxxxx> wrote:
>
> On Fri, Nov 5, 2021 at 7:04 PM Joel Fernandes <joelaf@xxxxxxxxxx> wrote:
> >
> > On Fri, Nov 5, 2021 at 1:44 PM Doug Anderson <dianders@xxxxxxxxxxxx> wrote:
> > [..]
> > >
> > >
> > > I tried gathering some tracing. One bit that might (?) be relevant:
> > >
> > > cros_ec_spi_hig-179 [000] d.h5 1495.305919: sched_waking:
> > > comm=kworker/4:2 pid=5232 prio=120 target_cpu=004
> > > cros_ec_spi_hig-179 [000] d.h6 1495.305926: sched_wakeup:
> > > comm=kworker/4:2 pid=5232 prio=120 target_cpu=004
> > > <idle>-0 [001] d.H5 1495.309113: sched_waking:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > <idle>-0 [001] d.H6 1495.309119: sched_wakeup:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > cros_ec_spi_hig-179 [000] d.h5 1495.309336: sched_waking:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > cros_ec_spi_hig-179 [000] d.h6 1495.309341: sched_wakeup:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > <idle>-0 [001] d.H5 1495.312137: sched_waking:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > <idle>-0 [001] d.H6 1495.312142: sched_wakeup:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > cros_ec_spi_hig-179 [000] d.h5 1495.312859: sched_waking:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > > cros_ec_spi_hig-179 [000] d.h6 1495.312870: sched_wakeup:
> > > comm=sugov:6 pid=2658 prio=-1 target_cpu=006
> > >
> > > My best guess is that there's some bug in the scheduler where it just
> > > loops constantly picking an unthrottled RT task but then incorrectly
> > > decides that it's throttled and thus doesn't run it.
> >
> > Thanks for posting this. Tricky bit indeed. I was wondering if the
> > issue is here:
> > https://elixir.bootlin.com/linux/latest/source/kernel/sched/rt.c#L1031
>
> Errm, I meant Line 1060 in rt.c
> https://elixir.bootlin.com/linux/latest/source/kernel/sched/rt.c#L1060

AAARGH , I hate elixir. I meant this code in update_curr_rt() :

if (sched_rt_runtime_exceeded(rt_rq))
resched_curr(rq);