ctdb-locking: Set real-time priority for lock helpers
authorAmitay Isaacs <amitay@gmail.com>
Wed, 10 Sep 2014 08:14:24 +0000 (18:14 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 11 Sep 2014 09:31:10 +0000 (11:31 +0200)
To avoid lock helper starvation when userspace robust mutexes are
enabled.

Commit 6f072f85a138f595494dbec137bcf23d1e666acc removed reset_scheduler(),
to avoid resetting scheduler priority.  However, that is not sufficient
because of commit 1be8564e553ce044426dbe7b3987edf514832940, which sets
SCHED_RESET_ON_FORK flag.  With SCHED_RESET_ON_FORK, all CTDB child
processes will automatically have normal scheduling priority.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep 11 11:31:10 CEST 2014 on sn-devel-104

ctdb/server/ctdb_lock_helper.c

index 9e7535983e23e0ea0234c7ceeb08f20ab737ce9e..13764c646308cf4b7384cce2f7f166e7368a0d5d 100644 (file)
@@ -123,6 +123,8 @@ int main(int argc, char *argv[])
                exit(1);
        }
 
+       set_scheduler();
+
        ppid = atoi(argv[1]);
        write_fd = atoi(argv[2]);
        lock_type = argv[3];