On Thu Nov 10, 2022 at 10:43 AM AEST, Jordan Niethe wrote: > On Thu, 2022-07-28 at 16:31 +1000, Nicholas Piggin wrote: > [resend as utf-8, not utf-7] > > Use the spin_begin/spin_cpu_relax/spin_end APIs in qspinlock, which helps > > to prevent threads issuing a lot of expensive priority nops which may not > > have much effect due to immediately executing low then medium priority. > > Just a general comment regarding the spin_{begin,end} API, more complicated > than something like > > spin_begin() > for(;;) > spin_cpu_relax() > spin_end() > > it becomes difficult to keep track of. Unfortunately, I don't have any good > suggestions how to improve it. Hopefully with P10s wait instruction we can > maybe try and move away from this. > > It might be useful to comment the functions pre and post conditions regarding > expectations about spin_begin() and spin_end().
Yep, added some small comments. Thanks, Nick