summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_kern.c15
-rw-r--r--sys/geom/mirror/g_mirror.c5
-rw-r--r--sys/geom/raid3/g_raid3.c5
3 files changed, 19 insertions, 6 deletions
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c
index 762a1fd..6e6b301 100644
--- a/sys/geom/geom_kern.c
+++ b/sys/geom/geom_kern.c
@@ -47,8 +47,9 @@ __FBSDID("$FreeBSD$");
#include <sys/kthread.h>
#include <sys/lock.h>
#include <sys/mutex.h>
-#include <sys/sx.h>
#include <sys/sbuf.h>
+#include <sys/sched.h>
+#include <sys/sx.h>
#include <geom/geom.h>
#include <geom/geom_int.h>
@@ -87,7 +88,9 @@ g_up_procbody(void)
struct thread *tp = FIRST_THREAD_IN_PROC(p);
mtx_assert(&Giant, MA_NOTOWNED);
- tp->td_base_pri = PRIBIO;
+ mtx_lock_spin(&sched_lock);
+ sched_prio(tp, PRIBIO);
+ mtx_unlock_spin(&sched_lock);
for(;;) {
g_io_schedule_up(tp);
}
@@ -108,7 +111,9 @@ g_down_procbody(void)
struct thread *tp = FIRST_THREAD_IN_PROC(p);
mtx_assert(&Giant, MA_NOTOWNED);
- tp->td_base_pri = PRIBIO;
+ mtx_lock_spin(&sched_lock);
+ sched_prio(tp, PRIBIO);
+ mtx_unlock_spin(&sched_lock);
for(;;) {
g_io_schedule_down(tp);
}
@@ -129,7 +134,9 @@ g_event_procbody(void)
struct thread *tp = FIRST_THREAD_IN_PROC(p);
mtx_assert(&Giant, MA_NOTOWNED);
- tp->td_base_pri = PRIBIO;
+ mtx_lock_spin(&sched_lock);
+ sched_prio(tp, PRIBIO);
+ mtx_unlock_spin(&sched_lock);
for(;;) {
g_run_events();
tsleep(&g_wait_event, PRIBIO, "-", hz/10);
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 7725722..b10467d 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <geom/geom.h>
#include <sys/proc.h>
#include <sys/kthread.h>
+#include <sys/sched.h>
#include <geom/mirror/g_mirror.h>
@@ -1478,7 +1479,9 @@ g_mirror_worker(void *arg)
u_int nreqs;
sc = arg;
- curthread->td_base_pri = PRIBIO;
+ mtx_lock_spin(&sched_lock);
+ sched_prio(curthread, PRIBIO);
+ mtx_unlock_spin(&sched_lock);
nreqs = 0;
for (;;) {
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c
index 5dbf94b..939eeb3 100644
--- a/sys/geom/raid3/g_raid3.c
+++ b/sys/geom/raid3/g_raid3.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <geom/geom.h>
#include <sys/proc.h>
#include <sys/kthread.h>
+#include <sys/sched.h>
#include <geom/raid3/g_raid3.h>
@@ -1729,7 +1730,9 @@ g_raid3_worker(void *arg)
u_int nreqs;
sc = arg;
- curthread->td_base_pri = PRIBIO;
+ mtx_lock_spin(&sched_lock);
+ sched_prio(curthread, PRIBIO);
+ mtx_unlock_spin(&sched_lock);
nreqs = 0;
for (;;) {
OpenPOWER on IntegriCloud