diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2013-03-27 09:08:48 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-03-28 12:10:25 -0400 |
commit | 3990e04df085e0561ab34f84731dc5929585c526 (patch) | |
tree | cc61156879176cc6e014cba76938fba7d3e53ed6 | |
parent | 7c689e63a847316c1b2500f86891b0a574ce7e69 (diff) |
drbd: use sched_setscheduler()
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>
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 6 | ||||
-rw-r--r-- | include/linux/drbd.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index a75c0b134856..0f449bbf0edf 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -5257,9 +5257,11 @@ int drbd_asender(struct drbd_thread *thi) | |||
5257 | bool ping_timeout_active = false; | 5257 | bool ping_timeout_active = false; |
5258 | struct net_conf *nc; | 5258 | struct net_conf *nc; |
5259 | int ping_timeo, tcp_cork, ping_int; | 5259 | int ping_timeo, tcp_cork, ping_int; |
5260 | struct sched_param param = { .sched_priority = 2 }; | ||
5260 | 5261 | ||
5261 | current->policy = SCHED_RR; /* Make this a realtime task! */ | 5262 | rv = sched_setscheduler(current, SCHED_RR, ¶m); |
5262 | current->rt_priority = 2; /* more important than all other tasks */ | 5263 | if (rv < 0) |
5264 | conn_err(tconn, "drbd_asender: ERROR set priority, ret=%d\n", rv); | ||
5263 | 5265 | ||
5264 | while (get_t_state(thi) == RUNNING) { | 5266 | while (get_t_state(thi) == RUNNING) { |
5265 | drbd_thread_current_set_cpu(thi); | 5267 | drbd_thread_current_set_cpu(thi); |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 316330705fd7..1b4d4ee1168f 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -52,7 +52,7 @@ | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | extern const char *drbd_buildtag(void); | 54 | extern const char *drbd_buildtag(void); |
55 | #define REL_VERSION "8.4.2" | 55 | #define REL_VERSION "8.4.3" |
56 | #define API_VERSION 1 | 56 | #define API_VERSION 1 |
57 | #define PRO_VERSION_MIN 86 | 57 | #define PRO_VERSION_MIN 86 |
58 | #define PRO_VERSION_MAX 101 | 58 | #define PRO_VERSION_MAX 101 |