[PATCH] local_t Documentation update 2

2007-10-30 Thread Mathieu Desnoyers
local_t Documentation update 2 (this patch seems to have fallen off the grid, but is still providing useful information. It applies to 2.6.23-mm1.) Grant Grundler was asking for more detail about correct usage of local atomic operations and suggested adding the resulting summary to

[PATCH] local_t Documentation update 2

2007-10-30 Thread Mathieu Desnoyers
local_t Documentation update 2 (this patch seems to have fallen off the grid, but is still providing useful information. It applies to 2.6.23-mm1.) Grant Grundler was asking for more detail about correct usage of local atomic operations and suggested adding the resulting summary to

Re: [PATCH] local_t Documentation update 2

2007-08-29 Thread Grant Grundler
On Wed, Aug 29, 2007 at 08:19:53AM -0400, Mathieu Desnoyers wrote: > local_t Documentation update 2 > > Grant Grundler was asking for more detail about correct usage of local atomic > operations and suggested adding the resulting summary to local_ops.txt. > > "Please add a bit more detail. If

[PATCH] local_t Documentation update 2

2007-08-29 Thread Mathieu Desnoyers
local_t Documentation update 2 Grant Grundler was asking for more detail about correct usage of local atomic operations and suggested adding the resulting summary to local_ops.txt. "Please add a bit more detail. If DaveM is correct (he normally is), then there must be limits on how the local_t

[PATCH] local_t Documentation update 2

2007-08-29 Thread Mathieu Desnoyers
local_t Documentation update 2 Grant Grundler was asking for more detail about correct usage of local atomic operations and suggested adding the resulting summary to local_ops.txt. Please add a bit more detail. If DaveM is correct (he normally is), then there must be limits on how the local_t

Re: [PATCH] local_t Documentation update 2

2007-08-29 Thread Grant Grundler
On Wed, Aug 29, 2007 at 08:19:53AM -0400, Mathieu Desnoyers wrote: local_t Documentation update 2 Grant Grundler was asking for more detail about correct usage of local atomic operations and suggested adding the resulting summary to local_ops.txt. Please add a bit more detail. If DaveM is

Re: [Ltt-dev] [PATCH] local_t : Documentation - update

2007-01-09 Thread Mathieu Desnoyers
* Mathieu Desnoyers ([EMAIL PROTECTED]) wrote: > > So it is "one cpu may write, other cpus may read", and as big as > > long. Are you sure obscure architectures (sparc?) can implement this > > in useful way? ... maybe yes, unless obscure architecture exists where > > second other cpu can see

Re: [PATCH] local_t : Documentation - update

2007-01-09 Thread Mathieu Desnoyers
* Pavel Machek ([EMAIL PROTECTED]) wrote: > > index dfeec94..bd854b3 100644 > > --- a/Documentation/local_ops.txt > > +++ b/Documentation/local_ops.txt > > @@ -22,6 +22,13 @@ require disabling interrupts to protect from interrupt > > handlers and it permits > > coherent counters in NMI handlers.

Re: [PATCH] local_t : Documentation - update

2007-01-09 Thread Pavel Machek
Hi! > > AFAICT this fails to mention... Is local_t as big as int? As big as > > long? Or perhaps smaller because high bits may be needed for locking? > > Hi Pavel, > > Here is an update that adds the information you mentionned in this reply and > the > one to Andrew. Thanks for the comments. >

Re: [PATCH] local_t : Documentation - update

2007-01-09 Thread Mathieu Desnoyers
* Pavel Machek ([EMAIL PROTECTED]) wrote: > Hi! > > AFAICT this fails to mention... Is local_t as big as int? As big as > long? Or perhaps smaller because high bits may be needed for locking? > > Pavel > Hi Pavel, Here is

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Pavel Machek
Hi! > > > These patches extend and standardise local_t operations on each > > > architectures, > > > allowing a rich set of atomic operations to be done on per-cpu data with > > > minimal performance impact. On some architectures, there seems to be no > > > difference between the SMP and UP

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Pavel Machek
On Tue 2007-01-09 13:01:10, Andrew Morton wrote: > On Mon, 8 Jan 2007 22:14:46 -0500 > Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > +* How to use local atomic operations > > + > > +#include > > +#include > > + > > +static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0); > > + > > + > >

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Andrew Morton
On Tue, 9 Jan 2007 17:06:16 -0500 Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > * Andrew Morton ([EMAIL PROTECTED]) wrote: > > On Mon, 8 Jan 2007 22:14:46 -0500 > > Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > > > +* How to use local atomic operations > > > + > > > +#include > > >

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Mathieu Desnoyers
* Andrew Morton ([EMAIL PROTECTED]) wrote: > On Mon, 8 Jan 2007 22:14:46 -0500 > Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > +* How to use local atomic operations > > + > > +#include > > +#include > > + > > +static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0); > > + > > + > > +*

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Andrew Morton
On Mon, 8 Jan 2007 22:14:46 -0500 Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > +* How to use local atomic operations > + > +#include > +#include > + > +static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0); > + > + > +* Counting > + > +In preemptible context, use get_cpu_var() and

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Andrew Morton
On Mon, 8 Jan 2007 22:14:46 -0500 Mathieu Desnoyers [EMAIL PROTECTED] wrote: +* How to use local atomic operations + +#include linux/percpu.h +#include asm/local.h + +static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0); + + +* Counting + +In preemptible context, use get_cpu_var()

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Mathieu Desnoyers
* Andrew Morton ([EMAIL PROTECTED]) wrote: On Mon, 8 Jan 2007 22:14:46 -0500 Mathieu Desnoyers [EMAIL PROTECTED] wrote: +* How to use local atomic operations + +#include linux/percpu.h +#include asm/local.h + +static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0); + + +*

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Andrew Morton
On Tue, 9 Jan 2007 17:06:16 -0500 Mathieu Desnoyers [EMAIL PROTECTED] wrote: * Andrew Morton ([EMAIL PROTECTED]) wrote: On Mon, 8 Jan 2007 22:14:46 -0500 Mathieu Desnoyers [EMAIL PROTECTED] wrote: +* How to use local atomic operations + +#include linux/percpu.h +#include

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Pavel Machek
On Tue 2007-01-09 13:01:10, Andrew Morton wrote: On Mon, 8 Jan 2007 22:14:46 -0500 Mathieu Desnoyers [EMAIL PROTECTED] wrote: +* How to use local atomic operations + +#include linux/percpu.h +#include asm/local.h + +static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0); + +

Re: [PATCH] local_t : Documentation

2007-01-09 Thread Pavel Machek
Hi! These patches extend and standardise local_t operations on each architectures, allowing a rich set of atomic operations to be done on per-cpu data with minimal performance impact. On some architectures, there seems to be no difference between the SMP and UP operation (same

Re: [PATCH] local_t : Documentation - update

2007-01-09 Thread Mathieu Desnoyers
* Pavel Machek ([EMAIL PROTECTED]) wrote: Hi! AFAICT this fails to mention... Is local_t as big as int? As big as long? Or perhaps smaller because high bits may be needed for locking? Pavel Hi Pavel, Here is an

Re: [PATCH] local_t : Documentation - update

2007-01-09 Thread Pavel Machek
Hi! AFAICT this fails to mention... Is local_t as big as int? As big as long? Or perhaps smaller because high bits may be needed for locking? Hi Pavel, Here is an update that adds the information you mentionned in this reply and the one to Andrew. Thanks for the comments. Mathieu

Re: [PATCH] local_t : Documentation - update

2007-01-09 Thread Mathieu Desnoyers
* Pavel Machek ([EMAIL PROTECTED]) wrote: index dfeec94..bd854b3 100644 --- a/Documentation/local_ops.txt +++ b/Documentation/local_ops.txt @@ -22,6 +22,13 @@ require disabling interrupts to protect from interrupt handlers and it permits coherent counters in NMI handlers. It is

Re: [Ltt-dev] [PATCH] local_t : Documentation - update

2007-01-09 Thread Mathieu Desnoyers
* Mathieu Desnoyers ([EMAIL PROTECTED]) wrote: So it is one cpu may write, other cpus may read, and as big as long. Are you sure obscure architectures (sparc?) can implement this in useful way? ... maybe yes, unless obscure architecture exists where second other cpu can see garbage data

[PATCH] local_t : Documentation

2007-01-08 Thread Mathieu Desnoyers
* Pavel Machek ([EMAIL PROTECTED]) wrote: > Hi! > > > These patches extend and standardise local_t operations on each > > architectures, > > allowing a rich set of atomic operations to be done on per-cpu data with > > minimal performance impact. On some architectures, there seems to be no > >

[PATCH] local_t : Documentation

2007-01-08 Thread Mathieu Desnoyers
* Pavel Machek ([EMAIL PROTECTED]) wrote: Hi! These patches extend and standardise local_t operations on each architectures, allowing a rich set of atomic operations to be done on per-cpu data with minimal performance impact. On some architectures, there seems to be no difference