You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
audio: pipeline: change locking strategy for user LL builds
Modify the locking approach for CONFIG_SOF_USERSPACE_LL builds.
Kernel LL implementation heavily relies on ability to disable
interrupts when IPC handler is modifying the graph. This ensures
a new LL tick and execution of a new graph cycle does not start
before the graph modifications done by IPC handler are complete.
In user-space, this approach is not available as user-space thread
cannot disable interrupts. In commit 1e59ce2 ("pipeline: protect
component connections with a mutex"), a sys_mutex based locking was
implemented to protect the component list and modifications to it. This
approach does not scale in the end as this would require taking the
mutex for each component of each pipeline, and take the locks on every
LL cycle tick. This results in significant system call overhead.
Additionally Zephyr sys_mutex does not work correctly if the lock
object is put into dynamically allocated user memory.
In this commit, locking the LL graph is moved to a higher level.
A single lock is used to protect the whole LL graph, and the lock
is taken at start of LL tick. The same lock is taken by the IPC handlers
when modifications to the graph are taken. The mutex interface supports
priority inversion, so this usage is safe if LL timer tick happens
while IPC processing is still in progress.
The patch only changes behaviour for userspace LL SOF builds. If
LL scheduling is kept in kernel, locking is done as before.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
0 commit comments