Re: [PATCH v2 4/5] locking/qspinlock: Introduce starvation avoidance into CNA

2019-04-03 Thread Alex Kogan
> On Apr 2, 2019, at 6:37 AM, Peter Zijlstra wrote: > > On Fri, Mar 29, 2019 at 11:20:05AM -0400, Alex Kogan wrote: >> @@ -25,6 +29,18 @@ >> >> #define MCS_NODE(ptr) ((struct mcs_spinlock *)(ptr)) >> >> +/* Per-CPU pseudo-random number seed */ >> +static DEFINE_PER_CPU(u32, seed); >> + >> +/*

Re: [PATCH v2 4/5] locking/qspinlock: Introduce starvation avoidance into CNA

2019-04-02 Thread Peter Zijlstra
On Fri, Mar 29, 2019 at 11:20:05AM -0400, Alex Kogan wrote: > @@ -25,6 +29,18 @@ > > #define MCS_NODE(ptr) ((struct mcs_spinlock *)(ptr)) > > +/* Per-CPU pseudo-random number seed */ > +static DEFINE_PER_CPU(u32, seed); > + > +/* > + * Controls the probability for intra-node lock hand-off. It