Re: [PATCH v5] eal: add seqlock

2022-05-08 Thread Mattias Rönnblom
On 2022-05-06 03:26, fengchengwen wrote: On 2022/5/1 22:03, 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

RE: [PATCH v5] eal: add seqlock

2022-05-05 Thread Honnappa Nagarahalli
> >>> +__rte_experimental > >>> +static inline bool > >>> +rte_seqlock_read_retry(const rte_seqlock_t *seqlock, uint32_t > >>> +begin_sn) { > >>> + uint32_t end_sn; > >>> + > >>> + /* An odd sequence number means the protected data was being > >>> + * modified already at the point of the rte_seq

RE: [PATCH v5] eal: add seqlock

2022-05-05 Thread Honnappa Nagarahalli
> > +__rte_experimental > > +static inline bool > > +rte_seqlock_read_retry(const rte_seqlock_t *seqlock, uint32_t > > +begin_sn) { > > + uint32_t end_sn; > > + > > + /* An odd sequence number means the protected data was being > > +* modified already at the point of the rte_seqlock_read_

Re: [PATCH v5] eal: add seqlock

2022-05-01 Thread David Marchand
On Sun, May 1, 2022 at 4:22 PM Mattias Rönnblom wrote: > > On 2022-05-01 16:03, Mattias Rönnblom wrote: > > A sequence lock (seqlock) is synchronization primitive which allows > > "/../ is a /../" > > > > David, maybe you can fix this typo? Unless there is a need for a new > version. Noted. No n

Re: [PATCH v5] eal: add seqlock

2022-05-01 Thread Mattias Rönnblom
On 2022-05-01 22:17, Stephen Hemminger wrote: > On Sun, 1 May 2022 16:03:27 +0200 > Mattias Rönnblom wrote: > >> +struct data { >> +rte_seqlock_t lock; >> + >> +uint64_t a; >> +uint64_t b __rte_cache_aligned; >> +uint64_t c __rte_cache_aligned; >> +} __rte_cache_aligned; > > This

Re: [PATCH v5] eal: add seqlock

2022-05-01 Thread Stephen Hemminger
On Sun, 1 May 2022 16:03:27 +0200 Mattias Rönnblom wrote: > +struct data { > + rte_seqlock_t lock; > + > + uint64_t a; > + uint64_t b __rte_cache_aligned; > + uint64_t c __rte_cache_aligned; > +} __rte_cache_aligned; This will end up taking 192 bytes per lock. Which is a lot espe

Re: [PATCH v5] eal: add seqlock

2022-05-01 Thread Mattias Rönnblom
On 2022-05-01 16:03, Mattias Rönnblom wrote: A sequence lock (seqlock) is synchronization primitive which allows "/../ is a /../" David, maybe you can fix this typo? Unless there is a need for a new version.

[PATCH v5] eal: add seqlock

2022-05-01 Thread Mattias Rönnblom
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 of seqlock imp