提交 3990e04d 编写于 作者: P Philipp Reisner 提交者: Jens Axboe

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: NCharlie Suffin <Charlie.Suffin@stratus.com>
Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 7c689e63
...@@ -5257,9 +5257,11 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5257,9 +5257,11 @@ int drbd_asender(struct drbd_thread *thi)
bool ping_timeout_active = false; bool ping_timeout_active = false;
struct net_conf *nc; struct net_conf *nc;
int ping_timeo, tcp_cork, ping_int; int ping_timeo, tcp_cork, ping_int;
struct sched_param param = { .sched_priority = 2 };
current->policy = SCHED_RR; /* Make this a realtime task! */ rv = sched_setscheduler(current, SCHED_RR, &param);
current->rt_priority = 2; /* more important than all other tasks */ if (rv < 0)
conn_err(tconn, "drbd_asender: ERROR set priority, ret=%d\n", rv);
while (get_t_state(thi) == RUNNING) { while (get_t_state(thi) == RUNNING) {
drbd_thread_current_set_cpu(thi); drbd_thread_current_set_cpu(thi);
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#endif #endif
extern const char *drbd_buildtag(void); extern const char *drbd_buildtag(void);
#define REL_VERSION "8.4.2" #define REL_VERSION "8.4.3"
#define API_VERSION 1 #define API_VERSION 1
#define PRO_VERSION_MIN 86 #define PRO_VERSION_MIN 86
#define PRO_VERSION_MAX 101 #define PRO_VERSION_MAX 101
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册