Re: [RFC] rwlock: prevent readers from starving writers

2022-07-09 Thread Stephen Hemminger
On Sat, 9 Jul 2022 00:04:27 +0200 Morten Brørup wrote: > Always the creative mind, Stephen. :-) > > You might consider adding/updating even more comments. > > Acked-by: Morten Brørup The motivation is that our work load is reader/writer lock heavy with small number of threads. Therefore the n

Re: [RFC] rwlock: prevent readers from starving writers

2022-07-09 Thread Stephen Hemminger
On Sat, 9 Jul 2022 00:04:27 +0200 Morten Brørup wrote: > > > typedef struct { > > > - volatile int32_t cnt; /**< -1 when W lock held, > 0 when R locks > > held. > > > */ > > > + volatile int32_t cnt; > > Not signed anymore, so consider uint32_t. Suggest also rename to cnt_state or > simi

RE: [RFC] rwlock: prevent readers from starving writers

2022-07-08 Thread Morten Brørup
> From: Honnappa Nagarahalli [mailto:honnappa.nagaraha...@arm.com] > Sent: Friday, 8 July 2022 21.22 > > > > > > The original reader/writer lock in DPDK can cause a stream of readers > to > > starve writers. > > > > The new version uses an additional bit to indicate that a writer is > waiting and

RE: [RFC] rwlock: prevent readers from starving writers

2022-07-08 Thread Honnappa Nagarahalli
> > The original reader/writer lock in DPDK can cause a stream of readers to > starve writers. > > The new version uses an additional bit to indicate that a writer is waiting > and > which keeps readers from starving the writer. This addition makes sense. I am wondering if we should create a ne

[RFC] rwlock: prevent readers from starving writers

2022-07-07 Thread Stephen Hemminger
The original reader/writer lock in DPDK can cause a stream of readers to starve writers. The new version uses an additional bit to indicate that a writer is waiting and which keeps readers from starving the writer. Signed-off-by: Stephen Hemminger --- Would like this to be in 22.11, but needs so