Re: 2.6.9-rc3-mm2

From: Ingo Molnar
Date: Mon Oct 04 2004 - 16:35:18 EST



* Andrew Morton <akpm@xxxxxxxx> wrote:

> Andrew Morton <akpm@xxxxxxxx> 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@xxxxxxx>

--- 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/