diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-09-12 11:22:36 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-09-12 08:46:14 +0200 |
commit | d410b20601cccd8b67d48c42a6d689cd65e94f61 (patch) | |
tree | 84f7587c0f849a24a827401faa1029f2505e2a6f /ctdb/common | |
parent | 7ae7a9c46301e4fed870516c448a79bb7a9ac53a (diff) | |
download | samba-d410b20601cccd8b67d48c42a6d689cd65e94f61.tar.gz |
ctdb-daemon: Make sure ctdb runs with real-time priority
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/common')
-rw-r--r-- | ctdb/common/system_util.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c index 692bc25623a..8e8f4ac2174 100644 --- a/ctdb/common/system_util.c +++ b/ctdb/common/system_util.c @@ -37,7 +37,7 @@ /* if possible, make this task real time */ -void set_scheduler(void) +bool set_scheduler(void) { #ifdef _AIX_ #if HAVE_THREAD_SETSCHED @@ -47,14 +47,15 @@ void set_scheduler(void) ti = 0ULL; if (getthrds64(getpid(), &te, sizeof(te), &ti, 1) != 1) { DEBUG(DEBUG_ERR, ("Unable to get thread information\n")); - return; + return false; } if (thread_setsched(te.ti_tid, 0, SCHED_RR) == -1) { DEBUG(DEBUG_ERR, ("Unable to set scheduler to SCHED_RR (%s)\n", strerror(errno))); + return false; } else { - DEBUG(DEBUG_NOTICE, ("Set scheduler to SCHED_RR\n")); + return true; } #endif #else /* no AIX */ @@ -70,11 +71,13 @@ void set_scheduler(void) if (sched_setscheduler(0, policy, &p) == -1) { DEBUG(DEBUG_CRIT,("Unable to set scheduler to SCHED_FIFO (%s)\n", strerror(errno))); + return false; } else { - DEBUG(DEBUG_NOTICE,("Set scheduler to SCHED_FIFO\n")); + return true; } #endif #endif + return false; } /* |