[patch] Real-Time Preemption, -RT-2.6.12-rc1-V0.7.41-05

Ingo Molnar
2005-03-22T10:02:12Z

* Ingo Molnar <mingo@elte.hu> wrote:

> hm, another thing: i think call_rcu() needs to take the read-lock.
> Right now it assumes that it has the data structure private, but
> that's only statistically true on PREEMPT_RT: another CPU may have
> this CPU's RCU control structure in use. So IRQs-off (or preempt-off)
> is not a guarantee to have the data structure, the read lock has to be
> taken.

i've reworked the code to use the read-lock to access the per-CPU data
RCU structures, and it boots with 2 CPUs and PREEMPT_RT now. The -40-05
patch can be downloaded from the usual place:

http://redhat.com/~mingo/realtime-preempt/

had to add two hacks though:

static void rcu_advance_callbacks(struct rcu_data *rdp)
{
if (rdp->batch != rcu_ctrlblk.batch) {
if (rdp->donetail) // HACK
*rdp->donetail = rdp->waitlist;
...

void fastcall call_rcu(struct rcu_head *head,
void (*func)(struct rcu_head *rcu))
[...]
rcu_advance_callbacks(rdp);
if (rdp->waittail) // HACK
*rdp->waittail = head;
...

without them it crashes during bootup.

maybe we are better off with the completely unlocked read path and the
long grace periods.

Ingo