Re: [patch] Real-Time Preemption, -RT-2.6.12-rc1-V0.7.41-01

Ingo Molnar
2005-03-23T06:21:58Z

* Paul E. McKenney <paulmck@us.ibm.com> wrote:

> !!! The difference is that in the stock kernel, rcu_check_callbacks()
> is invoked from irq. In PREEMPT_RT, it is invoked from process
> context and appears to be preemptible. This means that
> rcu_advance_callbacks() can be preempted, resulting in all sorts of
> problems. Need to disable preemption over this.

we can disable preemption in the PREEMPT_RT kernel too, but only for
code we know the maximum execution length of. I.e. we dont want want to
disable preemption while processing the callback _list_, but we can use
preemption-off to protect the per-cpu data structures.

> There are probably other bugs of this sort, I will track them down.
>
> But, just to make sure I understand -- if I have preempt disabled over
> all accesses to a per-CPU variable, and that variable is -not-
> accessed from a real interrupt handler, then I am safe without a lock,
> right?

correct, assuming that the pointer you get to the per-CPU data is truly
pointing to the current CPU's data. (i.e. the current->rcu_data pointer
approach breaks this assumption.)

Ingo