Re: [PATCH] pstore: Revert pmsg_lock back to a normal mutex

Joel Fernandes
2023-03-04T03:25:09Z

On Sat, Mar 04, 2023 at 03:01:30AM +0000, Joel Fernandes wrote:
[...]
> > > > > Either way, I think a comment should go on top of the "if (top_waiter !=
> > > > > waiter)" check IMO.
> > > >
> > > > What type of comment?
> > >
> > > Comment explaining why "if (top_waiter != waiter)" is essential :-).
> >
>
> Maybe "/* Only the top waiter needs to spin. If we are no longer the
> top-waiter, no point in spinning, as we do not get the lock next anyway. */"
>
> ?

And it could be added to that comment that, we want to continue spinning as
long as the top-waiter is still on the CPU (even if we are no longer the
top-waiter).

thanks,

- Joel