Re: [patch] rt: res_counter fix, v2

Peter Zijlstra
2009-02-12T14:58:25Z

On Thu, 2009-02-12 at 15:50 +0100, Frederic Weisbecker wrote:
>
> > maybe we should initialize it to -1 to make this more apparent?
>
>
> Or why not set p->{hard,soft}irq_disable_ip = NULL ? (or 0, I don't know its type).

It is to reflect the actual state at copy_process(), although I think
here's a little buglet:

ifdef CONFIG_TRACE_IRQFLAGS
p->irq_events = 0;
#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
p->hardirqs_enabled = 1;
#else
p->hardirqs_enabled = 0;
#endif
p->hardirq_enable_ip = 0;
p->hardirq_enable_event = 0;
p->hardirq_disable_ip = _THIS_IP_;
p->hardirq_disable_event = 0;
p->softirqs_enabled = 1;
p->softirq_enable_ip = _THIS_IP_;
p->softirq_enable_event = 0;
p->softirq_disable_ip = 0;
p->softirq_disable_event = 0;
p->hardirq_context = 0;
p->softirq_context = 0;
#endif

I think the hardirq_enable/disable_ip should also depend on
__ARCH_WANT_INTERRUPTS_ON_CTXSW.