2023-09-12 17:55:05

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible

On Mon, Sep 11, 2023 at 07:54:52PM -0400, Liam R. Howlett wrote:
> Taking the mutex lock in kernel/irq/manage.c __setup_irq() is calling a
> cond_resched().
>
> >From what Michael said [1] in this thread, since something has already
> set TIF_NEED_RESCHED, it will eventually enable interrupts on us.
>
> I've traced this to running call_rcu() in kernel/rcu/tiny.c and
> is_idle_task(current) is true, which means rcu runs:
> /* force scheduling for rcu_qs() */
> resched_cpu(0);
>
> the task is set idle in sched_init() -> init_idle() and never changed,
> afaict.

Should calling init_idle() be deferred until after interrupts are
all set up?


2023-09-13 02:02:53

by Liam R. Howlett

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible

* Matthew Wilcox <[email protected]> [230912 10:10]:
> On Mon, Sep 11, 2023 at 07:54:52PM -0400, Liam R. Howlett wrote:
> > Taking the mutex lock in kernel/irq/manage.c __setup_irq() is calling a
> > cond_resched().
> >
> > >From what Michael said [1] in this thread, since something has already
> > set TIF_NEED_RESCHED, it will eventually enable interrupts on us.
> >
> > I've traced this to running call_rcu() in kernel/rcu/tiny.c and
> > is_idle_task(current) is true, which means rcu runs:
> > /* force scheduling for rcu_qs() */
> > resched_cpu(0);
> >
> > the task is set idle in sched_init() -> init_idle() and never changed,
> > afaict.
>
> Should calling init_idle() be deferred until after interrupts are
> all set up?

At this point it is not platform specific code so I don't know what kind
of fallout I'll produce with a change like that, but I was wondering if
the thread running the boot process is really 'idle'?