[lkml]   [2007]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 3/3] [UDP6]: Counter increment on BH mode
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 we can then have two
CPUs trying to update the same counter which may corrupt it.

However, an optimisation is indeed possible with some work.
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 CPU ID and therefore avoid disabling

Hmm, wasn't Christoph working on something like that?

Visit Openswan at
Email: Herbert Xu ~{PmV>HI~} <>
Home Page:
PGP Key:

 \ /
  Last update: 2007-12-16 03:39    [W:0.090 / U:5.416 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site