lkml.org 
[lkml]   [2015]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v9 07/22] tracing: Add lock-free tracing_map
From
Date
On Thu, 2015-07-16 at 19:49 +0200, Peter Zijlstra wrote:
> On Thu, Jul 16, 2015 at 12:22:40PM -0500, Tom Zanussi wrote:
> > + for (i = 0; i < elt->map->n_fields; i++) {
> > + atomic64_set(&dup_elt->fields[i].sum,
> > + atomic64_read(&elt->fields[i].sum));
> > + dup_elt->fields[i].cmp_fn = elt->fields[i].cmp_fn;
> > + }
> > +
> > + return dup_elt;
> > +}
>
> So there is a lot of atomic64_{set,read}() in this patch set, what kind
> of magic properties do you assume they have?
>
> Note that atomic*_{set,read}() are weaker than {WRITE,READ}_ONCE(), so
> if you're assuming they do that, you're mistaken -- although it is on a
> TODO list someplace to go fix that.

Not assuming any magic properties - I just need an atomic 64-bit counter
for the sums and that's the API for setting/reading those. When reading
a live trace the exact sum you get is kind of arbitrary..

Tom



\
 
 \ /
  Last update: 2015-07-17 00:01    [W:0.128 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site