drbd: use sched_setscheduler()
authorPhilipp Reisner <philipp.reisner@linbit.com>
Wed, 27 Mar 2013 13:08:48 +0000 (14:08 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 28 Mar 2013 16:10:25 +0000 (10:10 -0600)
It was unnoticed for some time that assigning to current->policy is
no longer sufficient to set a real time priority for a kernel thread.

Reported-by: Charlie Suffin <Charlie.Suffin@stratus.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_receiver.c
include/linux/drbd.h

index a75c0b134856d2fea4a1690989c977ef96343cc5..0f449bbf0edf17082455f1806a4b86eabb96fbeb 100644 (file)
@@ -5257,9 +5257,11 @@ int drbd_asender(struct drbd_thread *thi)
        bool ping_timeout_active = false;
        struct net_conf *nc;
        int ping_timeo, tcp_cork, ping_int;
+       struct sched_param param = { .sched_priority = 2 };
 
-       current->policy = SCHED_RR;  /* Make this a realtime task! */
-       current->rt_priority = 2;    /* more important than all other tasks */
+       rv = sched_setscheduler(current, SCHED_RR, &param);
+       if (rv < 0)
+               conn_err(tconn, "drbd_asender: ERROR set priority, ret=%d\n", rv);
 
        while (get_t_state(thi) == RUNNING) {
                drbd_thread_current_set_cpu(thi);
index 316330705fd7216d1e3633ce9f8c704d0125b170..1b4d4ee1168ffb3b8ac90c42aaad073753573b1f 100644 (file)
@@ -52,7 +52,7 @@
 #endif
 
 extern const char *drbd_buildtag(void);
-#define REL_VERSION "8.4.2"
+#define REL_VERSION "8.4.3"
 #define API_VERSION 1
 #define PRO_VERSION_MIN 86
 #define PRO_VERSION_MAX 101