projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
4051130
)
workqueue: add nice support
author
Jens Axboe
<axboe@fb.com>
Tue, 8 Dec 2015 15:56:30 +0000
(08:56 -0700)
committer
Jens Axboe
<axboe@fb.com>
Tue, 8 Dec 2015 15:56:30 +0000
(08:56 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
workqueue.c
patch
|
blob
|
blame
|
history
workqueue.h
patch
|
blob
|
blame
|
history
diff --git
a/workqueue.c
b/workqueue.c
index 9fe7bec1a7cd6f874ee5185ebbdab9b78a6b8144..b9b098668094143f4a3e998d7f1294aca1dfac32 100644
(file)
--- a/
workqueue.c
+++ b/
workqueue.c
@@
-134,10
+134,19
@@
static void *worker_thread(void *data)
{
struct submit_worker *sw = data;
struct workqueue *wq = sw->wq;
- unsigned int eflags = 0, ret;
+ unsigned int eflags = 0, ret
= 0
;
FLIST_HEAD(local_list);
- ret = workqueue_init_worker(sw);
+ if (wq->ops.nice) {
+ if (nice(wq->ops.nice) < 0) {
+ log_err("workqueue: nice %s\n", strerror(errno));
+ ret = 1;
+ }
+ }
+
+ if (!ret)
+ ret = workqueue_init_worker(sw);
+
pthread_mutex_lock(&sw->lock);
sw->flags |= SW_F_RUNNING;
if (ret)
diff --git
a/workqueue.h
b/workqueue.h
index c2464b27709810dc0458fad63edda7299115fd4d..f732b3089d0a47dac49bcaf35e266be70fa9dfa5 100644
(file)
--- a/
workqueue.h
+++ b/
workqueue.h
@@
-40,6
+40,8
@@
struct workqueue_ops {
workqueue_init_worker_fn *init_worker_fn;
workqueue_exit_worker_fn *exit_worker_fn;
+
+ unsigned int nice;
};
struct workqueue {