[dpdk-dev] [EXT] [PATCH v1] ticketlock: ticket based to improve fairness

Gavin Hu (Arm Technology China) Gavin.Hu at arm.com
Mon Jan 14 17:57:30 CET 2019



> -----Original Message-----
> From: Jerin Jacob Kollanukkaran <jerinj at marvell.com>
> Sent: Monday, January 14, 2019 4:00 PM
> To: Gavin Hu (Arm Technology China) <Gavin.Hu at arm.com>;
> dev at dpdk.org
> Cc: stephen at networkplumber.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>; thomas at monjalon.net; nd
> <nd at arm.com>; Joyce Kong (Arm Technology China)
> <Joyce.Kong at arm.com>; hemant.agrawal at nxp.com
> Subject: Re: [EXT] [PATCH v1] ticketlock: ticket based to improve fairness
> 
> On Sun, 2019-01-13 at 22:46 +0800, Gavin Hu wrote:
> > -------------------------------------------------------------------
> > ---
> > From: Joyce Kong <joyce.kong at arm.com>
> >
> > The spinlock implementation is unfair, some threads may take locks
> > aggressively while leaving the other threads starving for long time.
> > As
> > shown in the following test, within same period of time, there are
> > threads taking locks much more times than the others.
> >
> > The ticketlock gives each waiting thread a ticket and they can take
> > the
> > lock one by one, first come, first serviced, this avoids starvation
> > for
> > too long time and is more predictable.
> >
> > *** spinlock_autotest without this patch ***
> > Core [0] count = 89
> > Core [1] count = 84
> > Core [2] count = 94
> > ...
> > Core [208] count = 171
> > Core [209] count = 152
> > Core [210] count = 161
> > Core [211] count = 187
> >
> > *** spinlock_autotest with this patch ***
> 
> This comment needs to be updated as it is new API now
> and we need add test case for the same. I think,
> making modification to exiting spinlock test case would be fine.

Thanks for you comments, we will do it and send a v2.


More information about the dev mailing list