Skip to contentSkip to conversation

master - activation: keep priority till memlock_unlock

PATCH Zdenek Kabelac 1 participant 1 message Dec 8, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=455b26b8dbdd05ec773a84da2ef64b669c80e194
Commit:        455b26b8dbdd05ec773a84da2ef64b669c80e194
Parent:        4e8af1d3aa136eae8dbb66186bfc331b0b2887e6
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Dec 8 13:11:35 2017 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Dec 8 13:21:15 2017 +0100

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 files changed, 1 insertions(+), 2 deletions(-)
lib/mm/memlock.c +1 -2
index f72b86c..897bf10 100644
@@ -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)