drbd/compat_blk_queue_stack_limits.patch

37 lines
1.6 KiB
Diff

1. c9ec0524 convert sched_setscheduler to sched_set_fifo*
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c 1970-01-01 08:00:00.000000000 +0800
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c 2020-10-20 10:48:02.070702635 +0800
@@ -0,0 +1,7 @@
+/* 6d2b84a4e and c9ec052470 Convert set_scheduler to sched_set_fifo* */
+#include <linux/sched.h>
+
+void test(struct task_struct *p)
+{
+ sched_set_fifo_low(p);
+}
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_receiver.c drbd-9.0.25~0+git.bd41626d/drbd/drbd_receiver.c
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_receiver.c 2020-10-20 10:48:14.058793953 +0800
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_receiver.c 2020-10-20 11:11:32.948922212 +0800
@@ -9241,13 +9241,18 @@
unsigned int header_size = drbd_header_size(connection);
int expect = header_size;
bool ping_timeout_active = false;
- struct sched_param param = { .sched_priority = 2 };
struct drbd_transport *transport = &connection->transport;
struct drbd_transport_ops *tr_ops = transport->ops;
+#ifdef COMPAT_HAVE_SCHED_SET_FIFO_LOW
+ sched_set_fifo_low(current);
+#else
+ struct sched_param param = { .sched_priority = 2 };
rv = sched_setscheduler(current, SCHED_RR, &param);
+
if (rv < 0)
drbd_err(connection, "drbd_ack_receiver: ERROR set priority, ret=%d\n", rv);
+#endif
while (get_t_state(thi) == RUNNING) {
drbd_thread_current_set_cpu(thi);