diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/workqueue.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 042d221d33cc..084aa47bac82 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -1364,6 +1364,17 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq, | |||
| 1364 | BUG_ON(timer_pending(timer)); | 1364 | BUG_ON(timer_pending(timer)); |
| 1365 | BUG_ON(!list_empty(&work->entry)); | 1365 | BUG_ON(!list_empty(&work->entry)); |
| 1366 | 1366 | ||
| 1367 | /* | ||
| 1368 | * If @delay is 0, queue @dwork->work immediately. This is for | ||
| 1369 | * both optimization and correctness. The earliest @timer can | ||
| 1370 | * expire is on the closest next tick and delayed_work users depend | ||
| 1371 | * on that there's no such delay when @delay is 0. | ||
| 1372 | */ | ||
| 1373 | if (!delay) { | ||
| 1374 | __queue_work(cpu, wq, &dwork->work); | ||
| 1375 | return; | ||
| 1376 | } | ||
| 1377 | |||
| 1367 | timer_stats_timer_set_start_info(&dwork->timer); | 1378 | timer_stats_timer_set_start_info(&dwork->timer); |
| 1368 | 1379 | ||
| 1369 | /* | 1380 | /* |
| @@ -1417,9 +1428,6 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | |||
| 1417 | bool ret = false; | 1428 | bool ret = false; |
| 1418 | unsigned long flags; | 1429 | unsigned long flags; |
| 1419 | 1430 | ||
| 1420 | if (!delay) | ||
| 1421 | return queue_work_on(cpu, wq, &dwork->work); | ||
| 1422 | |||
| 1423 | /* read the comment in __queue_work() */ | 1431 | /* read the comment in __queue_work() */ |
| 1424 | local_irq_save(flags); | 1432 | local_irq_save(flags); |
| 1425 | 1433 | ||
| @@ -2407,8 +2415,10 @@ static int rescuer_thread(void *__wq) | |||
| 2407 | repeat: | 2415 | repeat: |
| 2408 | set_current_state(TASK_INTERRUPTIBLE); | 2416 | set_current_state(TASK_INTERRUPTIBLE); |
| 2409 | 2417 | ||
| 2410 | if (kthread_should_stop()) | 2418 | if (kthread_should_stop()) { |
| 2419 | __set_current_state(TASK_RUNNING); | ||
| 2411 | return 0; | 2420 | return 0; |
| 2421 | } | ||
| 2412 | 2422 | ||
| 2413 | /* | 2423 | /* |
| 2414 | * See whether any cpu is asking for help. Unbounded | 2424 | * See whether any cpu is asking for help. Unbounded |
