lkml.org 
[lkml]   [2015]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 05/10] seqlock: Better document raw_write_seqcount_latch()
On Mon, Apr 13, 2015 at 06:32:02PM +0200, Ingo Molnar wrote:
>
> Btw., I realize this is just a sample, but couldn't this be written
> more optimally as:
>
> do {
> seq = READ_ONCE(latch->seq);
> smp_read_barrier_depends();
>
> idx = seq & 0x01;
> entry = data_query(latch->data[idx], ...);
>
> smp_rmb();
> } while (seq != latch->seq);
>

So in the actual code we use raw_read_seqcount() which includes the rmb.

This is true for the existing __ktime_get_fast_ns() as we as the new
latch_tee_find().

Should we look at introducing yet another seq primitive?



\
 
 \ /
  Last update: 2015-04-13 22:01    [W:0.213 / U:1.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site