Re: [PATCH v4] eal: add seqlock

2022-05-01 Thread Mattias Rönnblom
On 2022-04-28 12:28, David Marchand wrote: Hello Mattias, On Fri, Apr 8, 2022 at 4:25 PM Mattias Rönnblom wrote: A sequence lock (seqlock) is synchronization primitive which allows for data-race free, low-overhead, high-frequency reads, especially for data structures shared across many cores

Re: [PATCH v4] eal: add seqlock

2022-04-28 Thread David Marchand
Hello Mattias, On Fri, Apr 8, 2022 at 4:25 PM Mattias Rönnblom wrote: > > A sequence lock (seqlock) is synchronization primitive which allows > for data-race free, low-overhead, high-frequency reads, especially for > data structures shared across many cores and which are updated > relatively infr

RE: [PATCH v4] eal: add seqlock

2022-04-12 Thread Ananyev, Konstantin
> A sequence lock (seqlock) is synchronization primitive which allows > for data-race free, low-overhead, high-frequency reads, especially for > data structures shared across many cores and which are updated > relatively infrequently. > > A seqlock permits multiple parallel readers. The variant

Re: [PATCH v4] eal: add seqlock

2022-04-08 Thread Mattias Rönnblom
On 2022-04-08 16:24, Mattias Rönnblom wrote: PATCH v4: * Reverted to Linux kernel style naming on the read side. In this version I chose to adhere to kernel naming on the read side, but keep the write_lock()/unlock() on the write side. I think those names communicate better what the f

Re: [PATCH v4] eal: add seqlock

2022-04-08 Thread Stephen Hemminger
On Fri, 8 Apr 2022 16:24:42 +0200 Mattias Rönnblom wrote: > + /* A writer pegged the sequence number during the read operation. */ > + if (unlikely(begin_sn != end_sn)) > + return true; In some countries "pegged" might be considered inappropriate slang. Use incremented or cha

Re: [PATCH v4] eal: add seqlock

2022-04-08 Thread Stephen Hemminger
On Fri, 8 Apr 2022 16:24:42 +0200 Mattias Rönnblom wrote: > +++ b/lib/eal/common/rte_seqlock.c > @@ -0,0 +1,12 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2022 Ericsson AB > + */ > + > +#include > + > +void > +rte_seqlock_init(rte_seqlock_t *seqlock) > +{ > + seqlock->s