]> git.proxmox.com Git - corosync-pve.git/commitdiff
run at high priority using setpriority(-20)
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 15 Jan 2013 15:13:51 +0000 (16:13 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 16 Jan 2013 10:20:42 +0000 (11:20 +0100)
Makefile
debian/changelog
debian/patches/disable-sched-rr.patch

index e3cde317084726dad97f94b8b1b875dc44188bca..8bd3bdf725a065233469f2e0dfd92698ad3ca13a 100644 (file)
--- 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
 
index d8c42acca634673db2f48ed4e238db9077d9858a..1a4a4c5fc935c5d1be99aee4127ba54c0f7c3fd3 100644 (file)
@@ -1,3 +1,9 @@
+corosync-pve (1.4.4-3) unstable; urgency=low
+
+  * run at high priority using setpriority(-20)
+
+ -- Proxmox Support Team <support@proxmox.com>  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
index 69f6bc69a92221c465c8dcfc6d82a5f840106608..0ce96ee2411b3399cd8d7cd4759cc311471f12b5 100644 (file)
@@ -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));