From 86bc17db43c004665d8dc7a534c8ab44b29322f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Sat, 22 Apr 2017 17:58:49 +0200 Subject: [PATCH] SCHED_BATCH -> SCHED_IDLE It was a BOINC RasPi forum entry that let me revisit chrt and scheduler policies+priorities. The tasks are executed (if !highpriority) with the SCHED_BATCH policy. This also let me unearth again that SCHED_IDLE is what in the very early UNIX days was reached by renicing to the highest values but today SCHED_IDLE is less of a priority than SCHED_BATCH with nicelevel 19. I just executed the "chrt -i ..." manually and it seems just fine. Graphics still work. Communication with the BOINC servers is performed with a higher priority, which lets me think that we should expect any problem. So I suggest to have SCHED_IDLE the default for compute jobs. Best, Steffen --- client/app_start.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/app_start.cpp b/client/app_start.cpp index b0529d9ffd..ec2e056f74 100644 --- a/client/app_start.cpp +++ b/client/app_start.cpp @@ -1090,11 +1090,11 @@ int ACTIVE_TASK::start(bool test) { } } #endif -#if HAVE_SCHED_SETSCHEDULER && defined(SCHED_BATCH) && defined (__linux__) +#if HAVE_SCHED_SETSCHEDULER && defined(SCHED_IDLE) && defined (__linux__) if (!high_priority) { struct sched_param sp; sp.sched_priority = 0; - if (sched_setscheduler(0, SCHED_BATCH, &sp)) { + if (sched_setscheduler(0, SCHED_IDLE, &sp)) { perror("sched_setscheduler"); } }