Messages in this thread | | | Subject | Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks | From | Waiman Long <> | Date | Thu, 23 Jul 2020 10:29:05 -0400 |
| |
On 7/23/20 9:30 AM, Nicholas Piggin wrote: >> I would prefer to extract out the pending bit handling code out into a >> separate helper function which can be overridden by the arch code >> instead of breaking the slowpath into 2 pieces. > You mean have the arch provide a queued_spin_lock_slowpath_pending > function that the slow path calls? > > I would actually prefer the pending handling can be made inline in > the queued_spin_lock function, especially with out-of-line locks it > makes sense to put it there. > > We could ifdef out queued_spin_lock_slowpath_queue if it's not used, > then __queued_spin_lock_slowpath_queue would be inlined into the > caller so there would be no split?
The pending code is an optimization for lightly contended locks. That is why I think it is appropriate to extract it into a helper function and mark it as such.
You can certainly put the code in the arch's spin_lock code, you just has to override the generic pending code by a null function.
Cheers, Longman
| |