Lines Matching refs:worker

520 void __init_kthread_worker(struct kthread_worker *worker,  in __init_kthread_worker()  argument
524 spin_lock_init(&worker->lock); in __init_kthread_worker()
525 lockdep_set_class_and_name(&worker->lock, key, name); in __init_kthread_worker()
526 INIT_LIST_HEAD(&worker->work_list); in __init_kthread_worker()
527 worker->task = NULL; in __init_kthread_worker()
548 struct kthread_worker *worker = worker_ptr; in kthread_worker_fn() local
551 WARN_ON(worker->task); in kthread_worker_fn()
552 worker->task = current; in kthread_worker_fn()
558 spin_lock_irq(&worker->lock); in kthread_worker_fn()
559 worker->task = NULL; in kthread_worker_fn()
560 spin_unlock_irq(&worker->lock); in kthread_worker_fn()
565 spin_lock_irq(&worker->lock); in kthread_worker_fn()
566 if (!list_empty(&worker->work_list)) { in kthread_worker_fn()
567 work = list_first_entry(&worker->work_list, in kthread_worker_fn()
571 worker->current_work = work; in kthread_worker_fn()
572 spin_unlock_irq(&worker->lock); in kthread_worker_fn()
586 static void insert_kthread_work(struct kthread_worker *worker, in insert_kthread_work() argument
590 lockdep_assert_held(&worker->lock); in insert_kthread_work()
593 work->worker = worker; in insert_kthread_work()
594 if (!worker->current_work && likely(worker->task)) in insert_kthread_work()
595 wake_up_process(worker->task); in insert_kthread_work()
607 bool queue_kthread_work(struct kthread_worker *worker, in queue_kthread_work() argument
613 spin_lock_irqsave(&worker->lock, flags); in queue_kthread_work()
615 insert_kthread_work(worker, work, &worker->work_list); in queue_kthread_work()
618 spin_unlock_irqrestore(&worker->lock, flags); in queue_kthread_work()
647 struct kthread_worker *worker; in flush_kthread_work() local
651 worker = work->worker; in flush_kthread_work()
652 if (!worker) in flush_kthread_work()
655 spin_lock_irq(&worker->lock); in flush_kthread_work()
656 if (work->worker != worker) { in flush_kthread_work()
657 spin_unlock_irq(&worker->lock); in flush_kthread_work()
662 insert_kthread_work(worker, &fwork.work, work->node.next); in flush_kthread_work()
663 else if (worker->current_work == work) in flush_kthread_work()
664 insert_kthread_work(worker, &fwork.work, worker->work_list.next); in flush_kthread_work()
668 spin_unlock_irq(&worker->lock); in flush_kthread_work()
682 void flush_kthread_worker(struct kthread_worker *worker) in flush_kthread_worker() argument
689 queue_kthread_work(worker, &fwork.work); in flush_kthread_worker()