]> git.proxmox.com Git - mirror_corosync.git/commitdiff
corosync: move logsys thread config with all the others
authorFabio M. Di Nitto <fdinitto@redhat.com>
Mon, 10 Aug 2009 05:39:45 +0000 (05:39 +0000)
committerFabio M. Di Nitto <fdinitto@redhat.com>
Mon, 10 Aug 2009 05:39:45 +0000 (05:39 +0000)
logsys thread priority was configured after forking the
wthread process and spread the scheduler priority config
across a large chunk of code in main.c

Now that logsys scheduler priority can be invoked at any time,
move the code together with corosync_setscheduler code.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2383 fd59a12c-fef9-0310-b244-a6a79926bd2f

exec/main.c

index f85f77364bbd497a0a371f3c48014a604c62a3c8..41d3c99c6db1b7848c794bb63d53aeb21b789620 100644 (file)
@@ -699,11 +699,24 @@ static void corosync_setscheduler (void)
                        global_sched_param.sched_priority = 0;
                        log_printf (LOGSYS_LEVEL_WARNING, "Could not set SCHED_RR at priority %d: %s\n",
                                global_sched_param.sched_priority, strerror (errno));
+
+                       logsys_thread_priority_set (SCHED_OTHER, NULL, 1);
                } else {
                        /*
                         * Turn on SCHED_RR in ipc system
                         */
                        ipc_init_state.sched_policy = SCHED_RR;
+
+                       /*
+                        * Turn on SCHED_RR in logsys system
+                        */
+                       res = logsys_thread_priority_set (SCHED_RR, &global_sched_param, 10);
+                       if (res == -1) {
+                               log_printf (LOGSYS_LEVEL_ERROR,
+                                           "Could not set logsys thread priority."
+                                           " Can't continue because of priority inversions.");
+                               corosync_exit_error (AIS_DONE_LOGSETUP);
+                       }
                }
        } else {
                log_printf (LOGSYS_LEVEL_WARNING, "Could not get maximum scheduler priority: %s\n", strerror (errno));
@@ -899,16 +912,6 @@ int main (int argc, char **argv)
                corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
        }
        logsys_fork_completed();
-       if (setprio) {
-               res = logsys_thread_priority_set (SCHED_RR, &global_sched_param, 10);
-               if (res == -1) {
-                       log_printf (LOGSYS_LEVEL_ERROR,
-                               "Could not set logsys thread priority.  Can't continue because of priority inversions.");
-                       corosync_exit_error (AIS_DONE_LOGSETUP);
-               }
-       } else {
-               res = logsys_thread_priority_set (SCHED_OTHER, NULL, 1);
-       }
 
        /*
         * Make sure required directory is present