Lines Matching refs:work

725 	struct kthread_work *work;  in kthread_worker_fn()  local
748 work = NULL; in kthread_worker_fn()
751 work = list_first_entry(&worker->work_list, in kthread_worker_fn()
753 list_del_init(&work->node); in kthread_worker_fn()
755 worker->current_work = work; in kthread_worker_fn()
758 if (work) { in kthread_worker_fn()
759 kthread_work_func_t func = work->func; in kthread_worker_fn()
761 trace_sched_kthread_work_execute_start(work); in kthread_worker_fn()
762 work->func(work); in kthread_worker_fn()
767 trace_sched_kthread_work_execute_end(work, func); in kthread_worker_fn()
891 struct kthread_work *work) in queuing_blocked() argument
895 return !list_empty(&work->node) || work->canceling; in queuing_blocked()
899 struct kthread_work *work) in kthread_insert_work_sanity_check() argument
902 WARN_ON_ONCE(!list_empty(&work->node)); in kthread_insert_work_sanity_check()
904 WARN_ON_ONCE(work->worker && work->worker != worker); in kthread_insert_work_sanity_check()
909 struct kthread_work *work, in kthread_insert_work() argument
912 kthread_insert_work_sanity_check(worker, work); in kthread_insert_work()
914 trace_sched_kthread_work_queue_work(worker, work); in kthread_insert_work()
916 list_add_tail(&work->node, pos); in kthread_insert_work()
917 work->worker = worker; in kthread_insert_work()
935 struct kthread_work *work) in kthread_queue_work() argument
941 if (!queuing_blocked(worker, work)) { in kthread_queue_work()
942 kthread_insert_work(worker, work, &worker->work_list); in kthread_queue_work()
961 struct kthread_work *work = &dwork->work; in kthread_delayed_work_timer_fn() local
962 struct kthread_worker *worker = work->worker; in kthread_delayed_work_timer_fn()
974 WARN_ON_ONCE(work->worker != worker); in kthread_delayed_work_timer_fn()
977 WARN_ON_ONCE(list_empty(&work->node)); in kthread_delayed_work_timer_fn()
978 list_del_init(&work->node); in kthread_delayed_work_timer_fn()
979 if (!work->canceling) in kthread_delayed_work_timer_fn()
980 kthread_insert_work(worker, work, &worker->work_list); in kthread_delayed_work_timer_fn()
991 struct kthread_work *work = &dwork->work; in __kthread_queue_delayed_work() local
1003 kthread_insert_work(worker, work, &worker->work_list); in __kthread_queue_delayed_work()
1008 kthread_insert_work_sanity_check(worker, work); in __kthread_queue_delayed_work()
1010 list_add(&work->node, &worker->delayed_work_list); in __kthread_queue_delayed_work()
1011 work->worker = worker; in __kthread_queue_delayed_work()
1035 struct kthread_work *work = &dwork->work; in kthread_queue_delayed_work() local
1041 if (!queuing_blocked(worker, work)) { in kthread_queue_delayed_work()
1052 struct kthread_work work; member
1056 static void kthread_flush_work_fn(struct kthread_work *work) in kthread_flush_work_fn() argument
1059 container_of(work, struct kthread_flush_work, work); in kthread_flush_work_fn()
1069 void kthread_flush_work(struct kthread_work *work) in kthread_flush_work() argument
1072 KTHREAD_WORK_INIT(fwork.work, kthread_flush_work_fn), in kthread_flush_work()
1078 worker = work->worker; in kthread_flush_work()
1084 WARN_ON_ONCE(work->worker != worker); in kthread_flush_work()
1086 if (!list_empty(&work->node)) in kthread_flush_work()
1087 kthread_insert_work(worker, &fwork.work, work->node.next); in kthread_flush_work()
1088 else if (worker->current_work == work) in kthread_flush_work()
1089 kthread_insert_work(worker, &fwork.work, in kthread_flush_work()
1108 static void kthread_cancel_delayed_work_timer(struct kthread_work *work, in kthread_cancel_delayed_work_timer() argument
1112 container_of(work, struct kthread_delayed_work, work); in kthread_cancel_delayed_work_timer()
1113 struct kthread_worker *worker = work->worker; in kthread_cancel_delayed_work_timer()
1121 work->canceling++; in kthread_cancel_delayed_work_timer()
1125 work->canceling--; in kthread_cancel_delayed_work_timer()
1141 static bool __kthread_cancel_work(struct kthread_work *work) in __kthread_cancel_work() argument
1147 if (!list_empty(&work->node)) { in __kthread_cancel_work()
1148 list_del_init(&work->node); in __kthread_cancel_work()
1182 struct kthread_work *work = &dwork->work; in kthread_mod_delayed_work() local
1189 if (!work->worker) { in kthread_mod_delayed_work()
1195 WARN_ON_ONCE(work->worker != worker); in kthread_mod_delayed_work()
1209 kthread_cancel_delayed_work_timer(work, &flags); in kthread_mod_delayed_work()
1210 if (work->canceling) { in kthread_mod_delayed_work()
1215 ret = __kthread_cancel_work(work); in kthread_mod_delayed_work()
1225 static bool __kthread_cancel_work_sync(struct kthread_work *work, bool is_dwork) in __kthread_cancel_work_sync() argument
1227 struct kthread_worker *worker = work->worker; in __kthread_cancel_work_sync()
1236 WARN_ON_ONCE(work->worker != worker); in __kthread_cancel_work_sync()
1239 kthread_cancel_delayed_work_timer(work, &flags); in __kthread_cancel_work_sync()
1241 ret = __kthread_cancel_work(work); in __kthread_cancel_work_sync()
1243 if (worker->current_work != work) in __kthread_cancel_work_sync()
1250 work->canceling++; in __kthread_cancel_work_sync()
1252 kthread_flush_work(work); in __kthread_cancel_work_sync()
1254 work->canceling--; in __kthread_cancel_work_sync()
1278 bool kthread_cancel_work_sync(struct kthread_work *work) in kthread_cancel_work_sync() argument
1280 return __kthread_cancel_work_sync(work, false); in kthread_cancel_work_sync()
1295 return __kthread_cancel_work_sync(&dwork->work, true); in kthread_cancel_delayed_work_sync()
1309 KTHREAD_WORK_INIT(fwork.work, kthread_flush_work_fn), in kthread_flush_worker()
1313 kthread_queue_work(worker, &fwork.work); in kthread_flush_worker()