diff options
| author | Matt Macy <mmacy@FreeBSD.org> | 2018-05-11 04:47:05 +0000 |
|---|---|---|
| committer | Matt Macy <mmacy@FreeBSD.org> | 2018-05-11 04:47:05 +0000 |
| commit | ef7f29d8e6adac30c7125f8c185f22282155d926 (patch) | |
| tree | 22b01afe769db2b8919874a00df27e1afcc44084 /sys/tests | |
| parent | 04de51dbab28407db1ddb44dde23882569671f4f (diff) | |
Notes
Diffstat (limited to 'sys/tests')
| -rw-r--r-- | sys/tests/epoch/epoch_test.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/tests/epoch/epoch_test.c b/sys/tests/epoch/epoch_test.c index 8085183dc7a9..901024ea7b61 100644 --- a/sys/tests/epoch/epoch_test.c +++ b/sys/tests/epoch/epoch_test.c @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/module.h> #include <sys/mutex.h> +#include <sys/proc.h> +#include <sys/sched.h> #include <sys/smp.h> #include <sys/sysctl.h> #include <sys/systm.h> @@ -132,16 +134,24 @@ static struct epoch_test_instance etilist[MAXCPU]; static int test_modinit(void) { - int i, error; + struct thread *td; + int i, error, pri_range, pri_off; + pri_range = PRI_MIN_TIMESHARE - PRI_MIN_REALTIME; test_epoch = epoch_alloc(); - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < mp_ncpus*2; i++) { etilist[i].threadid = i; error = kthread_add(testloop, &etilist[i], NULL, &testthreads[i], 0, 0, "epoch_test_%d", i); if (error) { printf("%s: kthread_add(epoch_test): error %d", __func__, error); + } else { + pri_off = (i*4)%pri_range; + td = testthreads[i]; + thread_lock(td); + sched_prio(td, PRI_MIN_REALTIME + pri_off); + thread_unlock(td); } } inited = 1; |
