Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-20 Thread David Miller
From: Herbert Xu <[EMAIL PROTECTED]> Date: Sat, 15 Dec 2007 21:58:52 +0800 > [SNMP]: Fix SNMP counters with PREEMPT > > The SNMP macros use raw_smp_processor_id() in process context > which is illegal because the process may be preempted and then > migrated to another CPU. > > This patch makes i

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-17 Thread Christoph Lameter
On Sun, 16 Dec 2007, Herbert Xu wrote: > If we can get the address of the per-cpu counter against > some sort of a per-cpu base pointer, e.g., %gs on x86, then > we can do > > incq%gs:(%rax) > > where %rax would be the offset with %gs as the base. This would > obviate the need for the

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-17 Thread Christoph Lameter
The cpu alloc patches also fix this issue one way (disabling preempt) or the other (atomic instruction that does not need disabling of preeemption). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at ht

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-16 Thread Ingo Molnar
* Herbert Xu <[EMAIL PROTECTED]> wrote: > On Sat, Dec 15, 2007 at 07:43:28PM +0100, Ingo Molnar wrote: > > > > we could perhaps introduce stat_smp_processor_id(), which signals that > > the CPU id is used for statistical purposes and does not have to be > > exact? In any case, your patch looks

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-15 Thread Herbert Xu
On Sat, Dec 15, 2007 at 07:43:28PM +0100, Ingo Molnar wrote: > > we could perhaps introduce stat_smp_processor_id(), which signals that > the CPU id is used for statistical purposes and does not have to be > exact? In any case, your patch looks good too. Unfortunately that doesn't work because w

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-15 Thread Ingo Molnar
* Herbert Xu <[EMAIL PROTECTED]> wrote: > Ob Tue, Dec 04, 2007 at 12:17:23AM +1100, Herbert Xu wrote: > > > > Never mind, we already have that in local_t and as Alexey correctly > > points out, USER is still going to be the expensive variant with the > > preempt_disable (well until BH gets threa

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-15 Thread Eric Dumazet
Herbert Xu a écrit : Ob Tue, Dec 04, 2007 at 12:17:23AM +1100, Herbert Xu wrote: Never mind, we already have that in local_t and as Alexey correctly points out, USER is still going to be the expensive variant with the preempt_disable (well until BH gets threaded). So how about this patch? I d

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-15 Thread Herbert Xu
Ob Tue, Dec 04, 2007 at 12:17:23AM +1100, Herbert Xu wrote: > > Never mind, we already have that in local_t and as Alexey correctly > points out, USER is still going to be the expensive variant with the > preempt_disable (well until BH gets threaded). So how about this patch? I didn't hear any o

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-03 Thread Herbert Xu
On Tue, Dec 04, 2007 at 11:50:55AM +0800, Wang Chen wrote: > > > #include > > #include > > +#include > > It's no need to include smp.h? We need it for smp_processor_id. Well we needed it before too but there's probably some implicit inclusion which has made it work. It's better to declare t

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-03 Thread Wang Chen
Herbert Xu said the following on 2007-12-3 21:17: > On Mon, Dec 03, 2007 at 10:54:35PM +1100, Herbert Xu wrote: > diff --git a/include/net/snmp.h b/include/net/snmp.h > index ea206bf..9444b54 100644 > --- a/include/net/snmp.h > +++ b/include/net/snmp.h > @@ -23,6 +23,7 @@ > > #include > #inclu

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-03 Thread Herbert Xu
On Mon, Dec 03, 2007 at 10:54:35PM +1100, Herbert Xu wrote: > > Hmm, wasn't someone else talking about a non-atomic version of atomic > ops lately (i.e., atomic with respect to the local CPU only)? Perhaps > this is the killer app for it :) Never mind, we already have that in local_t and as Alexey

Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode

2007-12-03 Thread Herbert Xu
On Mon, Dec 03, 2007 at 02:49:12PM +0300, Alexey Kuznetsov wrote: > On Mon, Dec 03, 2007 at 10:39:35PM +1100, Herbert Xu wrote: > > So we need to fix this, and whatever the fix is will probably render > > the BH/USER distinction obsolete. > > Hmm, I would think opposite. USER (or generic) is expen