From 455b26b8dbdd05ec773a84da2ef64b669c80e194 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 8 Dec 2017 13:11:35 +0100 Subject: [PATCH] activation: keep priority till memlock_unlock Although it doesn't look like it can be a measurable problem and costs some time to flip priorities outside of activation window. So just like with memory locking preserve priority until call memlock_unlock() appears. (addition to commit c086dfadc389551b9a2d7b4c26931e5e74ada8d6). --- lib/mm/memlock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c index f72b86cc8..897bf10ee 100644 --- a/lib/mm/memlock.c +++ b/lib/mm/memlock.c @@ -627,8 +627,6 @@ void critical_section_dec(struct cmd_context *cmd, const char *reason) log_debug_activation("Leaving critical section (%s).", reason); } else log_debug_activation("Leaving section (%s).", reason); - - _restore_priority_if_possible(cmd); } int critical_section(void) @@ -683,6 +681,7 @@ void memlock_reset(void) void memlock_unlock(struct cmd_context *cmd) { _unlock_mem_if_possible(cmd); + _restore_priority_if_possible(cmd); } int memlock_count_daemon(void)