]> git.baikalelectronics.ru Git - kernel.git/commit
pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
authorJohn Stultz <jstultz@google.com>
Wed, 14 Dec 2022 23:18:34 +0000 (23:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:40 +0000 (11:41 +0100)
commit2cf3ea76fd06b0351ce71d479a542935e5689103
tree047d21b8a76dfc979a9a5e35f42960b991bcaa56
parentb9f077de3d6744f0cfebf5b764d84d532305b320
pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion

[ Upstream commit 5b651e82d8b5f78f8abdb63ff90cdeca6db4086d ]

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.

Cc: Wei Wang <wvw@google.com>
Cc: Midas Chien<midaschieh@google.com>
Cc: Connor O'Brien <connoro@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: kernel-team@android.com
Fixes: 20dfdfa89299 ("pstore: Add pmsg - user-space accessible pstore object")
Reported-by: Wei Wang <wvw@google.com>
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221214231834.3711880-1-jstultz@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/pstore/pmsg.c