From: Dietmar Maurer Date: Tue, 15 Jan 2013 15:13:51 +0000 (+0100) Subject: run at high priority using setpriority(-20) X-Git-Url: https://git.proxmox.com/?p=corosync-pve.git;a=commitdiff_plain;h=af5eee0cb17fc7526b3cd216de7110b2175a94de run at high priority using setpriority(-20) --- diff --git a/Makefile b/Makefile index e3cde31..8bd3bdf 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ RELEASE=2.3 # source from http://www.corosync.org CSVERSION=1.4.4 -CSRELEASE=2 +CSRELEASE=3 CSDIR=corosync-${CSVERSION} CSSRC=corosync-${CSVERSION}.orig.tar.gz diff --git a/debian/changelog b/debian/changelog index d8c42ac..1a4a4c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +corosync-pve (1.4.4-3) unstable; urgency=low + + * run at high priority using setpriority(-20) + + -- Proxmox Support Team Tue, 15 Jan 2013 12:54:02 +0100 + corosync-pve (1.4.4-2) unstable; urgency=low * disable SCHED_RR (RT_GROUP_SCHED was disabled in our kernel diff --git a/debian/patches/disable-sched-rr.patch b/debian/patches/disable-sched-rr.patch index 69f6bc6..0ce96ee 100644 --- a/debian/patches/disable-sched-rr.patch +++ b/debian/patches/disable-sched-rr.patch @@ -1,36 +1,71 @@ +Index: new/exec/timer.c +=================================================================== +--- new.orig/exec/timer.c 2013-01-16 11:12:46.000000000 +0100 ++++ new/exec/timer.c 2013-01-16 11:13:40.000000000 +0100 +@@ -109,7 +109,7 @@ + int fds; + unsigned long long timeout; + +-#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) ++#if 0 && defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) + if (sched_priority != 0) { + struct sched_param sched_param; + Index: new/exec/main.c =================================================================== ---- new.orig/exec/main.c 2013-01-11 15:35:35.000000000 +0100 -+++ new/exec/main.c 2013-01-11 15:36:39.000000000 +0100 -@@ -1265,7 +1265,7 @@ +--- new.orig/exec/main.c 2013-01-16 11:12:46.000000000 +0100 ++++ new/exec/main.c 2013-01-16 11:13:40.000000000 +0100 +@@ -1265,6 +1265,7 @@ static void corosync_setscheduler (void) { --#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) && defined(HAVE_SCHED_SETSCHEDULER) -+#if 0 && defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) && defined(HAVE_SCHED_SETSCHEDULER) ++#if 0 + #if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) && defined(HAVE_SCHED_SETSCHEDULER) int res; - sched_priority = sched_get_priority_max (SCHED_RR); -@@ -1301,9 +1301,6 @@ - "Could not get maximum scheduler priority"); - sched_priority = 0; - } --#else -- log_printf(LOGSYS_LEVEL_WARNING, -- "The Platform is missing process priority setting features. Leaving at default."); +@@ -1305,6 +1306,7 @@ + log_printf(LOGSYS_LEVEL_WARNING, + "The Platform is missing process priority setting features. Leaving at default."); #endif ++#endif } -Index: new/exec/timer.c + static void fplay_key_change_notify_fn ( +@@ -1585,6 +1587,11 @@ + corosync_setscheduler (); + } + ++ if (setpriority(PRIO_PGRP, 0, -20) < 0) { ++ fprintf(stderr, "setpriority failed\n"); ++ return EXIT_FAILURE; ++ } ++ + corosync_mlockall (); + + log_printf (LOGSYS_LEVEL_NOTICE, "Corosync Cluster Engine ('%s'): started and ready to provide service.\n", VERSION); +Index: new/exec/coroipcs.c =================================================================== ---- new.orig/exec/timer.c 2013-01-11 15:35:40.000000000 +0100 -+++ new/exec/timer.c 2013-01-11 15:35:46.000000000 +0100 -@@ -109,7 +109,7 @@ - int fds; - unsigned long long timeout; +--- new.orig/exec/coroipcs.c 2013-01-16 11:12:46.000000000 +0100 ++++ new/exec/coroipcs.c 2013-01-16 11:13:40.000000000 +0100 +@@ -661,7 +661,7 @@ + unsigned int new_message; + int sem_value = 0; -#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) +#if 0 && defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) - if (sched_priority != 0) { - struct sched_param sched_param; + if (api->sched_policy != 0) { + res = pthread_setschedparam (conn_info->thread, + api->sched_policy, api->sched_param); +Index: new/exec/logsys.c +=================================================================== +--- new.orig/exec/logsys.c 2013-01-16 11:15:29.000000000 +0100 ++++ new/exec/logsys.c 2013-01-16 11:15:35.000000000 +0100 +@@ -1568,7 +1568,7 @@ + return (0); + } +-#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) ++#if 0 && defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) + if (wthread_active == 0) { + logsys_sched_policy = policy; + memcpy(&logsys_sched_param, param, sizeof(struct sched_param));