Re: [RFC PATCH] locking/percpu-rwsem: do not do lock handoff in percpu_up_write

From: Hillf Danton
Date: Sat Jan 27 2024 - 06:21:12 EST


On Fri, 26 Jan 2024 12:40:43 -0800 Benjamin Segall <bsegall@xxxxxxxxxx>
>
> I'm fine with "no, fairness is more important than these performance
> numbers or mitigating already-sorta-broken situations", but it's not

Fine too because your patch is never able to escape standing ovation.

And feel free to specify the broken situations you saw.

> clear to me you've even understood the patch, because you keep only
> talking about completely different forms of starvation, and suggesting

Given woken writer in your reply and sem->ww is write waiters, there is
only one starvation in this thread.

|> >> My patch makes the entire #4 available to writers (or new readers), so
|> >> that the woken writer will instead get to run immediately. This is

> changes that would if anything make the situation worse.

I mitigate the starvation by making use of the known method without
any heuristic added, though, I am happy to see why it no longer works.