Re: [RFC PATCH] pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion

From: John Stultz
Date: Wed Dec 14 2022 - 18:08:35 EST


On Wed, Dec 14, 2022 at 2:53 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> On Mon, Dec 05, 2022 at 08:32:53PM +0000, John Stultz wrote:
> > Wei Wang reported seeing priority inversion caused latencies
> > caused by contention on pmsg_lock, and suggested it be switched
> > to a rt_mutex.
> >
> > I was initially hesitant this would help, as the tasks in that
> > trace all seemed to be SCHED_NORMAL, so the benefit would be
> > limited to only nice boosting.
> >
> > However, another similar issue was raised where the priority
> > inversion was seen did involve a blocked RT task so it is clear
> > this would be helpful in that case.
> >
> > Feedback would be appreciate!
>
> This looks fine to me. Is there an appropriate "Fixes:" tag that could
> be used?

Not other than the ~3.19 era original introduction of the pmsg.c file
where that mutex was introduced, I don't think.

But I'll respin with that.

thanks
-john