Re: 2.6.9-rc3-mm2

Ingo Molnar
2004-10-04T21:28:55Z

* Andrew Morton <akpm@osdl.org> wrote:

> Andrew Morton <akpm@osdl.org> wrote:
> >
> > You're the second person who is seeing in_interrupt() returning true when
> > clearly it should not be doing so. Ingo, did you do soemthing which might
> > have caused this?
>
> I'm suspecting that something is causing preempt_count() to overflow
> into the softirq counter. An imbalanced preempt_disable(), for
> example.

yes, that was it. Must not put side-effects into a macro that is NOP on
!SMP.

Ingo

Signed-off-by: Ingo Molnar <mingo@elte.hu>

--- linux/include/net/neighbour.h.orig
+++ linux/include/net/neighbour.h
@@ -113,8 +113,9 @@ struct neigh_statistics

#define NEIGH_CACHE_STAT_INC(tbl, field) \
do { \
- (per_cpu_ptr((tbl)->stats, get_cpu())->field)++; \
- put_cpu(); \
+ preempt_disable(); \
+ (per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \
+ preempt_enable(); \
} while (0)

struct neighbour