| /linux/io_uring/ |
| H A D | io-wq.c | 149 static void io_wq_dec_running(struct io_worker *worker); 166 static bool io_worker_get(struct io_worker *worker) in io_worker_get() argument 168 return refcount_inc_not_zero(&worker->ref); in io_worker_get() 171 static void io_worker_release(struct io_worker *worker) in io_worker_release() argument 173 if (refcount_dec_and_test(&worker->ref)) in io_worker_release() 174 complete(&worker->ref_done); in io_worker_release() 188 static inline struct io_wq_acct *io_wq_get_acct(struct io_worker *worker) in io_wq_get_acct() argument 190 return worker->acct; in io_wq_get_acct() 201 struct io_worker *worker = current->worker_private; in io_wq_worker_stopped() local 206 return test_bit(IO_WQ_BIT_EXIT, &worker->wq->state); in io_wq_worker_stopped() [all …]
|
| /linux/kernel/ |
| H A D | kthread.c | 958 void __kthread_init_worker(struct kthread_worker *worker, in __kthread_init_worker() argument 962 memset(worker, 0, sizeof(struct kthread_worker)); in __kthread_init_worker() 963 raw_spin_lock_init(&worker->lock); in __kthread_init_worker() 964 lockdep_set_class_and_name(&worker->lock, key, name); in __kthread_init_worker() 965 INIT_LIST_HEAD(&worker->work_list); in __kthread_init_worker() 966 INIT_LIST_HEAD(&worker->delayed_work_list); in __kthread_init_worker() 987 struct kthread_worker *worker = worker_ptr; in kthread_worker_fn() local 994 WARN_ON(worker->task && worker->task != current); in kthread_worker_fn() 995 worker->task = current; in kthread_worker_fn() 997 if (worker->flags & KTW_FREEZABLE) in kthread_worker_fn() [all …]
|
| H A D | workqueue.c | 3 * kernel/workqueue.c - generic async execution with shared worker pool 19 * executed in process context. The worker pool is shared and 20 * automatically managed. There are two worker pools for each CPU (one for 89 /* worker flags */ 94 WORKER_UNBOUND = 1 << 7, /* worker is unbound */ 95 WORKER_REBOUND = 1 << 8, /* worker was rebound */ 164 * K: Only modified by worker while holding pool->lock. Can be safely read by 168 * S: Only modified by worker self. 193 /* struct worker is defined in workqueue_internal.h */ 219 struct timer_list idle_timer; /* L: worker idl 601 for_each_pool_worker(worker,pool) global() argument 992 worker_set_flags(struct worker * worker,unsigned int flags) worker_set_flags() argument 1014 worker_clr_flags(struct worker * worker,unsigned int flags) worker_clr_flags() argument 1052 worker_enter_idle(struct worker * worker) worker_enter_idle() argument 1085 worker_leave_idle(struct worker * worker) worker_leave_idle() argument 1132 struct worker *worker; find_worker_executing_work() local 1203 assign_work(struct work_struct * work,struct worker * worker,struct work_struct ** nextp) assign_work() argument 1277 struct worker *worker = first_idle_worker(pool); kick_pool_pick() local 1452 struct worker *worker = kthread_data(task); wq_worker_running() local 1486 struct worker *worker = kthread_data(task); wq_worker_sleeping() local 1532 struct worker *worker = kthread_data(task); wq_worker_tick() local 1603 struct worker *worker = kthread_data(task); wq_worker_last_func() local 2286 struct worker *worker; is_chained_work() local 2392 struct worker *worker; __queue_work() local 2753 struct worker *worker; alloc_worker() local 2783 worker_attach_to_pool(struct worker * worker,struct worker_pool * pool) worker_attach_to_pool() argument 2809 unbind_worker(struct worker * worker) unbind_worker() argument 2821 detach_worker(struct worker * worker) detach_worker() argument 2837 worker_detach_from_pool(struct worker * worker) worker_detach_from_pool() argument 2853 format_worker_id(char * buf,size_t size,struct worker * worker,struct worker_pool * pool) format_worker_id() argument 2887 struct worker *worker; create_worker() local 2956 struct worker *worker; detach_dying_workers() local 2964 struct worker *worker, *tmp; reap_dying_workers() local 2984 set_worker_dying(struct worker * worker,struct list_head * list) set_worker_dying() argument 3036 struct worker *worker; idle_worker_timeout() local 3079 struct worker *worker; idle_cull_fn() local 3253 manage_workers(struct worker * worker) manage_workers() argument 3285 process_one_work(struct worker * worker,struct work_struct * work) process_one_work() argument 3468 process_scheduled_works(struct worker * worker) process_scheduled_works() argument 3507 struct worker *worker = __worker; worker_thread() local 3756 bh_worker(struct worker * worker) bh_worker() argument 3910 struct worker *worker; check_flush_dependency() local 3966 insert_wq_barrier(struct pool_workqueue * pwq,struct wq_barrier * barr,struct work_struct * target,struct worker * worker) insert_wq_barrier() argument 4349 struct worker *worker = NULL; start_flush_work() local 5136 struct worker *worker; put_unbound_pool() local 6284 struct worker *worker = current_wq_worker(); current_work() local 6300 struct worker *worker = current_wq_worker(); current_is_workqueue_rescuer() local 6321 struct worker *worker = current_wq_worker(); current_is_workqueue_mem_reclaim() local 6413 struct worker *worker = current_wq_worker(); set_worker_desc() local 6444 struct worker *worker; print_worker_info() local 6486 pr_cont_worker_id(struct worker * worker) pr_cont_worker_id() argument 6547 struct worker *worker; show_pwq() local 6669 struct worker *worker; show_one_worker_pool() local 6766 struct worker *worker = kthread_data(task); wq_worker_comm() local 6816 struct worker *worker; unbind_workers() local 6869 struct worker *worker; rebind_workers() local 6930 struct worker *worker; restore_unbound_workers_cpumask() local 7216 struct worker *worker; workqueue_apply_unbound_cpumask() local 7840 struct worker *worker; show_cpu_pool_busy_workers() local [all...] |
| H A D | async.c | 344 struct worker *worker = current_wq_worker(); in current_is_async() local 346 return worker && worker->current_func == async_run_entry_fn; in current_is_async()
|
| /linux/tools/perf/bench/ |
| H A D | futex-hash.c | 44 struct worker { struct 76 struct worker *w = (struct worker *) arg; in workerfn() 134 struct worker *worker = NULL; in bench_futex_hash() local 162 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_hash() 163 if (!worker) in bench_futex_hash() 188 worker[i].tid = i; in bench_futex_hash() 189 worker[i].futex = calloc(params.nfutexes, sizeof(*worker[i].futex)); in bench_futex_hash() 190 if (!worker[i].futex) in bench_futex_hash() 201 ret = pthread_create(&worker[i].thread, &thread_attr, workerfn, in bench_futex_hash() 202 (void *)(struct worker *) &worker[i]); in bench_futex_hash() [all …]
|
| H A D | futex-lock-pi.c | 27 struct worker { struct 35 static struct worker *worker; argument 87 struct worker *w = (struct worker *) arg; in workerfn() 124 static void create_threads(struct worker *w, struct perf_cpu_map *cpu) in create_threads() 141 worker[i].tid = i; in create_threads() 144 worker[i].futex = calloc(1, sizeof(u_int32_t)); in create_threads() 145 if (!worker[i].futex) in create_threads() 148 worker[i].futex = &global_futex; in create_threads() 158 if (pthread_create(&w[i].thread, &thread_attr, workerfn, &worker[i])) { in create_threads() 195 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_lock_pi() [all …]
|
| H A D | epoll-ctl.c | 67 struct worker { struct 132 static inline void do_epoll_op(struct worker *w, int op, int fd) in do_epoll_op() 160 static inline void do_random_epoll_op(struct worker *w) in do_random_epoll_op() 174 struct worker *w = (struct worker *) arg; in workerfn() 204 static void init_fdmaps(struct worker *w, int pct) in init_fdmaps() 223 static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) in do_threads() argument 241 struct worker *w = &worker[i]; in do_threads() 277 (void *)(struct worker *) w); in do_threads() 317 struct worker *worker = NULL; in bench_epoll_ctl() local 352 worker = calloc(nthreads, sizeof(*worker)); in bench_epoll_ctl() [all …]
|
| H A D | sched-messaging.c | 150 static void create_thread_worker(union messaging_worker *worker, in create_thread_worker() argument 164 ret = pthread_create(&worker->thread, &attr, func, ctx); in create_thread_worker() 171 static void create_process_worker(union messaging_worker *worker, in create_process_worker() argument 175 worker->pid = fork(); in create_process_worker() 177 if (worker->pid == -1) { in create_process_worker() 179 } else if (worker->pid == 0) { in create_process_worker() 185 static void create_worker(union messaging_worker *worker, in create_worker() argument 189 return create_process_worker(worker, ctx, func); in create_worker() 191 return create_thread_worker(worker, ctx, func); in create_worker() 194 static void reap_worker(union messaging_worker *worker) in reap_worker() argument 210 group(union messaging_worker * worker,unsigned int num_fds,int ready_out,int wakefd) group() argument [all...] |
| H A D | futex-wake.c | 36 static pthread_t *worker; variable 172 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_wake() 173 if (!worker) in bench_futex_wake() 195 block_threads(worker, cpu); in bench_futex_wake() 224 ret = pthread_join(worker[i], NULL); in bench_futex_wake() 238 free(worker); in bench_futex_wake()
|
| H A D | futex-requeue.c | 36 static pthread_t *worker; variable 197 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_requeue() 198 if (!worker) in bench_futex_requeue() 228 block_threads(worker, cpu); in bench_futex_requeue() 300 ret = pthread_join(worker[i], NULL); in bench_futex_requeue() 313 free(worker); in bench_futex_requeue()
|
| /linux/drivers/vhost/ |
| H A D | vhost.c | 244 static void vhost_worker_queue(struct vhost_worker *worker, in vhost_worker_queue() argument 252 llist_add(&work->node, &worker->work_list); in vhost_worker_queue() 253 worker->ops->wakeup(worker); in vhost_worker_queue() 259 struct vhost_worker *worker; in vhost_vq_work_queue() local 263 worker = rcu_dereference(vq->worker); in vhost_vq_work_queue() 264 if (worker) { in vhost_vq_work_queue() 266 vhost_worker_queue(worker, work); in vhost_vq_work_queue() 280 static void __vhost_worker_flush(struct vhost_worker *worker) in __vhost_worker_flush() argument 284 if (!worker->attachment_cnt || worker->killed) in __vhost_worker_flush() 290 vhost_worker_queue(worker, &flush.work); in __vhost_worker_flush() [all …]
|
| /linux/drivers/net/wireguard/ |
| H A D | queueing.c | 13 struct multicore_worker __percpu *worker = alloc_percpu(struct multicore_worker); in wg_packet_percpu_multicore_worker_alloc() local 15 if (!worker) in wg_packet_percpu_multicore_worker_alloc() 19 per_cpu_ptr(worker, cpu)->ptr = ptr; in wg_packet_percpu_multicore_worker_alloc() 20 INIT_WORK(&per_cpu_ptr(worker, cpu)->work, function); in wg_packet_percpu_multicore_worker_alloc() 22 return worker; in wg_packet_percpu_multicore_worker_alloc() 35 queue->worker = wg_packet_percpu_multicore_worker_alloc(function, queue); in wg_packet_queue_init() 36 if (!queue->worker) { in wg_packet_queue_init() 45 free_percpu(queue->worker); in wg_packet_queue_free()
|
| /linux/drivers/hid/ |
| H A D | hid-asus.c | 162 struct asus_worker *worker; member 393 static void asus_worker_schedule(struct asus_worker *worker, struct asus_work_action *action) in asus_worker_schedule() argument 395 if (worker->removed) { in asus_worker_schedule() 400 list_add_tail(&action->node, &worker->actions); in asus_worker_schedule() 401 schedule_work(&worker->work); in asus_worker_schedule() 418 spin_lock_irqsave(&drvdata->worker->lock, flags); in asus_kbd_fn_lock_set() 419 asus_worker_schedule(drvdata->worker, action); in asus_kbd_fn_lock_set() 420 spin_unlock_irqrestore(&drvdata->worker->lock, flags); in asus_kbd_fn_lock_set() 445 spin_lock_irqsave(&drvdata->worker->lock, flags); in asus_kbd_wmi_fan_send() 446 asus_worker_schedule(drvdata->worker, action); in asus_kbd_wmi_fan_send() [all …]
|
| /linux/include/linux/ |
| H A D | kthread.h | 156 struct kthread_worker *worker; member 184 extern void __kthread_init_worker(struct kthread_worker *worker, 187 #define kthread_init_worker(worker) \ argument 190 __kthread_init_worker((worker), "("#worker")->lock", &__key); \ 263 bool kthread_queue_work(struct kthread_worker *worker, 266 bool kthread_queue_delayed_work(struct kthread_worker *worker, 270 bool kthread_mod_delayed_work(struct kthread_worker *worker, 275 void kthread_flush_worker(struct kthread_worker *worker); 280 void kthread_destroy_worker(struct kthread_worker *worker);
|
| H A D | devm-helpers.h | 48 work_func_t worker) in devm_delayed_work_autocancel() argument 50 INIT_DELAYED_WORK(w, worker); in devm_delayed_work_autocancel() 73 work_func_t worker) in devm_work_autocancel() argument 75 INIT_WORK(w, worker); in devm_work_autocancel()
|
| /linux/drivers/gpio/ |
| H A D | gpio-mpsse.c | 24 struct mutex irq_race; /* race for polling worker teardown */ 25 raw_spinlock_t irq_spin; /* protects worker list */ 373 struct mpsse_worker *worker, *worker_tmp; in gpio_mpsse_stop_all_except() 377 list_for_each_entry_safe(worker, worker_tmp, in gpio_mpsse_stop_all_except() 380 if (worker == my_worker) in gpio_mpsse_stop_all_except() 383 list_del(&worker->list); in gpio_mpsse_stop_all_except() 385 /* Give worker a chance to terminate itself */ in gpio_mpsse_stop_all_except() 386 atomic_set(&worker->cancelled, 1); in gpio_mpsse_stop_all_except() 388 INIT_LIST_HEAD(&worker->destroy); in gpio_mpsse_stop_all_except() 389 list_add(&worker in gpio_mpsse_stop_all_except() 370 struct mpsse_worker *worker, *worker_tmp; gpio_mpsse_stop_all_except() local 493 struct mpsse_worker *worker; gpio_mpsse_irq_disable() local 511 struct mpsse_worker *worker; gpio_mpsse_irq_enable() local [all...] |
| /linux/tools/testing/selftests/sched_ext/ |
| H A D | cyclic_kick_wait.c | 45 struct worker_ctx *worker = arg; in worker_fn() local 49 CPU_SET(worker->cpu, &mask); in worker_fn() 54 while (!worker->stop) { in worker_fn() 56 worker->iters++; in worker_fn() 62 static int join_worker(struct worker_ctx *worker) in join_worker() argument 68 if (!worker->started) in join_worker() 75 err = pthread_timedjoin_np(worker->tid, &ret, &ts); in join_worker() 77 pthread_detach(worker->tid); in join_worker()
|
| /linux/samples/seccomp/ |
| H A D | user-trap.c | 208 pid_t worker = 0 , tracer = 0; in main() local 215 worker = fork(); in main() 216 if (worker < 0) { in main() 221 if (worker == 0) { in main() 347 if (waitpid(worker, &status, 0) != worker) { in main() 372 if (worker > 0) in main() 373 kill(worker, SIGKILL); in main()
|
| /linux/Documentation/core-api/ |
| H A D | workqueue.rst | 20 queue is called workqueue and the thread is called worker. 22 While there are work items on the workqueue the worker executes the 24 there is no work item left on the workqueue the worker becomes idle. 25 When a new work item gets queued, the worker begins executing again. 32 worker thread per CPU and a single threaded (ST) wq had one worker 42 worker pool. An MT wq could provide only one execution context per CPU 60 * Use per-CPU unified worker pools shared by all wq to provide 64 * Automatically regulate worker pool and level of concurrency so that 84 the worker threads become idle. These worker threads are managed in 85 worker-pools. [all …]
|
| /linux/drivers/block/ |
| H A D | loop.c | 809 struct loop_worker *cur_worker, *worker = NULL; in loop_queue_work() local 824 worker = cur_worker; in loop_queue_work() 832 if (worker) in loop_queue_work() 835 worker = kzalloc_obj(struct loop_worker, GFP_NOWAIT); in loop_queue_work() 840 if (!worker) { in loop_queue_work() 848 worker->blkcg_css = cmd->blkcg_css; in loop_queue_work() 849 css_get(worker->blkcg_css); in loop_queue_work() 850 INIT_WORK(&worker->work, loop_workfn); in loop_queue_work() 851 INIT_LIST_HEAD(&worker->cmd_list); in loop_queue_work() 852 INIT_LIST_HEAD(&worker->idle_list); in loop_queue_work() [all …]
|
| /linux/drivers/md/ |
| H A D | dm-delay.c | 39 struct task_struct *worker; member 71 return !!dc->worker; in delay_is_fast() 174 if (dc->worker) in delay_dtr() 175 kthread_stop(dc->worker); in delay_dtr() 284 dc->worker = kthread_run(&flush_worker_fn, dc, "dm-delay-flush-worker"); in delay_ctr() 285 if (IS_ERR(dc->worker)) { in delay_ctr() 286 ret = PTR_ERR(dc->worker); in delay_ctr() 287 dc->worker = NULL; in delay_ctr() 337 wake_up_process(dc->worker); in delay_bio()
|
| /linux/drivers/gpu/drm/msm/ |
| H A D | msm_kms.c | 247 if (kms->event_thread[i].worker) in msm_drm_kms_uninit() 248 kthread_destroy_worker(kms->event_thread[i].worker); in msm_drm_kms_uninit() 309 ev_thread->worker = kthread_run_worker(0, "crtc_event:%d", crtc->base.id); in msm_drm_kms_init() 310 if (IS_ERR(ev_thread->worker)) { in msm_drm_kms_init() 311 ret = PTR_ERR(ev_thread->worker); in msm_drm_kms_init() 313 ev_thread->worker = NULL; in msm_drm_kms_init() 317 sched_set_fifo(ev_thread->worker->task); in msm_drm_kms_init()
|
| /linux/fs/erofs/ |
| H A D | zdata.c | 306 struct kthread_worker *worker; in erofs_destroy_percpu_workers() local 310 worker = rcu_dereference_protected( in erofs_destroy_percpu_workers() 313 if (worker) in erofs_destroy_percpu_workers() 314 kthread_destroy_worker(worker); in erofs_destroy_percpu_workers() 321 struct kthread_worker *worker = in erofs_init_percpu_worker() local 324 if (IS_ERR(worker)) in erofs_init_percpu_worker() 325 return worker; in erofs_init_percpu_worker() 327 sched_set_fifo_low(worker->task); in erofs_init_percpu_worker() 328 return worker; in erofs_init_percpu_worker() 333 struct kthread_worker *worker; in erofs_init_percpu_workers() local [all …]
|
| /linux/drivers/crypto/caam/ |
| H A D | caamrng.c | 43 struct work_struct worker; member 143 worker); in caam_rng_worker() 161 schedule_work(&ctx->worker); in caam_read() 170 flush_work(&ctx->worker); in caam_cleanup() 241 INIT_WORK(&ctx->worker, caam_rng_worker); in caam_init()
|
| /linux/drivers/gpu/drm/ |
| H A D | drm_flip_work.c | 98 queue_work(wq, &work->worker); in drm_flip_work_commit() 104 struct drm_flip_work *work = container_of(w, struct drm_flip_work, worker); in flip_worker() 144 INIT_WORK(&work->worker, flip_worker); in drm_flip_work_init()
|