/linux/io_uring/ |
H A D | io-wq.c | 342 wq = worker->wq; in create_worker_cb() 698 if (!worker) in io_wq_worker_running() 716 if (!worker) in io_wq_worker_sleeping() 775 wq = worker->wq; in create_worker_cont() 800 kfree(worker); in create_worker_cont() 815 kfree(worker); in io_workqueue_create() 826 worker = kzalloc(sizeof(*worker), GFP_KERNEL); in create_io_worker() 827 if (!worker) { in create_io_worker() 838 worker->wq = wq; in create_io_worker() 849 kfree(worker); in create_io_worker() [all …]
|
/linux/kernel/ |
H A D | kthread.c | 865 worker = kzalloc(sizeof(*worker), GFP_KERNEL); in __kthread_create_worker() 984 WARN_ON_ONCE(work->worker && work->worker != worker); in kthread_insert_work_sanity_check() 997 work->worker = worker; in kthread_insert_work() 1042 struct kthread_worker *worker = work->worker; in kthread_delayed_work_timer_fn() local 1054 WARN_ON_ONCE(work->worker != worker); in kthread_delayed_work_timer_fn() 1090 work->worker = worker; in __kthread_queue_delayed_work() 1157 worker = work->worker; in kthread_flush_work() 1163 WARN_ON_ONCE(work->worker != worker); in kthread_flush_work() 1192 struct kthread_worker *worker = work->worker; in kthread_cancel_delayed_work_timer() local 1274 WARN_ON_ONCE(work->worker != worker); in kthread_mod_delayed_work() [all …]
|
H A D | workqueue.c | 1112 struct worker *worker; in find_worker_executing_work() local 2221 struct worker *worker; in is_chained_work() local 2303 struct worker *worker; in __queue_work() local 2656 struct worker *worker; in alloc_worker() local 2759 struct worker *worker; in create_worker() local 2916 struct worker *worker; in idle_worker_timeout() local 2959 struct worker *worker; in idle_cull_fn() local 3696 struct worker *worker; in check_flush_dependency() local 4891 struct worker *worker; in put_unbound_pool() local 6071 struct worker *worker; in print_worker_info() local [all …]
|
/linux/tools/perf/bench/ |
H A D | futex-hash.c | 43 struct worker { struct 73 struct worker *w = (struct worker *) arg; in workerfn() 130 struct worker *worker = NULL; in bench_futex_hash() local 158 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_hash() 159 if (!worker) in bench_futex_hash() 183 worker[i].tid = i; in bench_futex_hash() 184 worker[i].futex = calloc(params.nfutexes, sizeof(*worker[i].futex)); in bench_futex_hash() 197 (void *)(struct worker *) &worker[i]); in bench_futex_hash() 234 worker[i].tid, &worker[i].futex[0], t); in bench_futex_hash() 237 worker[i].tid, &worker[i].futex[0], in bench_futex_hash() [all …]
|
H A D | epoll-wait.c | 186 struct worker *w = (struct worker *) arg; in workerfn() 318 struct worker *w = &worker[i]; in do_threads() 382 struct worker *worker = p; in writerfn() local 398 struct worker *w = &worker[i]; in writerfn() 421 struct worker *w1 = (struct worker *) p1; in cmpworker() 422 struct worker *w2 = (struct worker *) p2; in cmpworker() 431 struct worker *worker = NULL; in bench_epoll_wait() local 471 worker = calloc(nthreads, sizeof(*worker)); in bench_epoll_wait() 511 (void *)(struct worker *) worker); in bench_epoll_wait() 542 worker[i].tid, &worker[i].fdmap[0], t); in bench_epoll_wait() [all …]
|
H A D | futex-lock-pi.c | 27 struct worker { struct 35 static struct worker *worker; variable 84 struct worker *w = (struct worker *) arg; in workerfn() 138 worker[i].tid = i; in create_threads() 142 if (!worker[i].futex) in create_threads() 192 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_lock_pi() 193 if (!worker) in bench_futex_lock_pi() 210 create_threads(worker, cpu); in bench_futex_lock_pi() 239 worker[i].tid, worker[i].futex, t); in bench_futex_lock_pi() 242 zfree(&worker[i].futex); in bench_futex_lock_pi() [all …]
|
H A D | epoll-ctl.c | 67 struct worker { struct 174 struct worker *w = (struct worker *) arg; in workerfn() 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() 317 struct worker *worker = NULL; in bench_epoll_ctl() local 352 worker = calloc(nthreads, sizeof(*worker)); in bench_epoll_ctl() 353 if (!worker) in bench_epoll_ctl() 412 worker[i].tid, &worker[i].fdmap[0], in bench_epoll_ctl() 416 worker[i].tid, &worker[i].fdmap[0], in bench_epoll_ctl() 426 free(worker[i].fdmap); in bench_epoll_ctl() [all …]
|
H A D | sched-messaging.c | 164 ret = pthread_create(&worker->thread, &attr, func, ctx); in create_thread_worker() 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 205 pthread_join(worker->thread, &thread_status); in reap_worker() 210 static unsigned int group(union messaging_worker *worker, in group() argument [all …]
|
H A D | futex-wake.c | 36 static pthread_t *worker; variable 169 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_wake() 170 if (!worker) in bench_futex_wake() 192 block_threads(worker, cpu); in bench_futex_wake() 221 ret = pthread_join(worker[i], NULL); in bench_futex_wake() 235 free(worker); in bench_futex_wake()
|
H A D | futex-requeue.c | 36 static pthread_t *worker; variable 194 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_requeue() 195 if (!worker) in bench_futex_requeue() 223 block_threads(worker, cpu); in bench_futex_requeue() 295 ret = pthread_join(worker[i], NULL); in bench_futex_requeue() 308 free(worker); in bench_futex_requeue()
|
/linux/drivers/vhost/ |
H A D | vhost.c | 255 worker = rcu_dereference(vq->worker); in vhost_vq_work_queue() 256 if (worker) { in vhost_vq_work_queue() 276 if (!worker->attachment_cnt || worker->killed) in __vhost_worker_flush() 316 worker = rcu_dereference(vq->worker); in vhost_vq_has_work() 317 if (worker && !llist_empty(&worker->work_list)) in vhost_vq_has_work() 660 worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); in vhost_worker_create() 709 rcu_assign_pointer(vq->worker, worker); in __vhost_vq_attach_worker() 774 if (!worker || worker->id != info->worker_id) in vhost_vq_attach_worker() 803 if (!worker || worker->id != info->worker_id) in vhost_free_worker() 807 if (worker->attachment_cnt || worker->killed) { in vhost_free_worker() [all …]
|
/linux/include/linux/ |
H A D | kthread.h | 135 struct kthread_worker *worker; member 163 extern void __kthread_init_worker(struct kthread_worker *worker, 166 #define kthread_init_worker(worker) \ argument 169 __kthread_init_worker((worker), "("#worker")->lock", &__key); \ 197 bool kthread_queue_work(struct kthread_worker *worker, 200 bool kthread_queue_delayed_work(struct kthread_worker *worker, 204 bool kthread_mod_delayed_work(struct kthread_worker *worker, 209 void kthread_flush_worker(struct kthread_worker *worker); 214 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/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/gpu/drm/ |
H A D | drm_vblank_work.c | 60 kthread_queue_work(vblank->worker, &work->base); in drm_handle_vblank_works() 150 ret = kthread_queue_work(vblank->worker, &work->base); in drm_vblank_work_schedule() 254 struct kthread_worker *worker; in drm_vblank_worker_init() local 258 worker = kthread_create_worker(0, "card%d-crtc%d", in drm_vblank_worker_init() 261 if (IS_ERR(worker)) in drm_vblank_worker_init() 262 return PTR_ERR(worker); in drm_vblank_worker_init() 264 vblank->worker = worker; in drm_vblank_worker_init() 266 sched_set_fifo(worker->task); in drm_vblank_worker_init()
|
H A D | drm_flip_work.c | 97 queue_work(wq, &work->worker); in drm_flip_work_commit() 103 struct drm_flip_work *work = container_of(w, struct drm_flip_work, worker); in flip_worker() 143 INIT_WORK(&work->worker, flip_worker); in drm_flip_work_init()
|
/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/drivers/gpu/drm/msm/ |
H A D | msm_atomic.c | 118 timer->worker = kthread_create_worker(0, "atomic-worker-%d", crtc_idx); in msm_atomic_init_pending_timer() 119 if (IS_ERR(timer->worker)) { in msm_atomic_init_pending_timer() 120 int ret = PTR_ERR(timer->worker); in msm_atomic_init_pending_timer() 121 timer->worker = NULL; in msm_atomic_init_pending_timer() 124 sched_set_fifo(timer->worker->task); in msm_atomic_init_pending_timer() 126 msm_hrtimer_work_init(&timer->work, timer->worker, in msm_atomic_init_pending_timer() 135 if (timer->worker) in msm_atomic_destroy_pending_timer() 136 kthread_destroy_worker(timer->worker); in msm_atomic_destroy_pending_timer()
|
H A D | msm_kms.c | 215 if (priv->event_thread[i].worker) in msm_drm_kms_uninit() 216 kthread_destroy_worker(priv->event_thread[i].worker); in msm_drm_kms_uninit() 272 ev_thread->worker = kthread_create_worker(0, "crtc_event:%d", crtc->base.id); in msm_drm_kms_init() 273 if (IS_ERR(ev_thread->worker)) { in msm_drm_kms_init() 274 ret = PTR_ERR(ev_thread->worker); in msm_drm_kms_init() 276 ev_thread->worker = NULL; in msm_drm_kms_init() 280 sched_set_fifo(ev_thread->worker->task); in msm_drm_kms_init()
|
H A D | msm_io_utils.c | 120 kthread_queue_work(work->worker, &work->work); in msm_hrtimer_worktimer() 133 struct kthread_worker *worker, in msm_hrtimer_work_init() argument 140 work->worker = worker; in msm_hrtimer_work_init()
|
/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 32 worker thread per CPU and a single threaded (ST) wq had one worker 60 * Use per-CPU unified worker pools shared by all wq to provide 84 the worker threads become idle. These worker threads are managed in 85 worker-pools. 98 Each per-CPU BH worker pool contains only one pseudo worker which represents 188 worker-pools which host workers which are not bound to any 215 worker-pool of the target cpu. Highpri worker-pools are 216 served by worker threads with elevated nice level. [all …]
|
/linux/drivers/i2c/ |
H A D | i2c-slave-testunit.c | 43 struct delayed_work worker; member 48 struct testunit_data *tu = container_of(work, struct testunit_data, worker.work); in i2c_slave_testunit_work() 118 queue_delayed_work(system_long_wq, &tu->worker, in i2c_slave_testunit_slave_cb() 151 INIT_DELAYED_WORK(&tu->worker, i2c_slave_testunit_work); in i2c_slave_testunit_probe() 160 cancel_delayed_work_sync(&tu->worker); in i2c_slave_testunit_remove()
|
/linux/drivers/block/ |
H A D | loop.c | 857 worker = cur_worker; in loop_queue_work() 865 if (worker) in loop_queue_work() 873 if (!worker) { in loop_queue_work() 882 css_get(worker->blkcg_css); in loop_queue_work() 886 worker->lo = lo; in loop_queue_work() 890 if (worker) { in loop_queue_work() 898 work = &worker->work; in loop_queue_work() 927 css_put(worker->blkcg_css); in loop_free_idle_workers() 928 kfree(worker); in loop_free_idle_workers() 1976 if (worker && !work_pending(&worker->work)) { in loop_process_work() [all …]
|
/linux/drivers/md/ |
H A D | dm-delay.c | 36 struct task_struct *worker; member 67 return !!dc->worker; in delay_is_fast() 169 if (dc->worker) in delay_dtr() 170 kthread_stop(dc->worker); in delay_dtr() 273 dc->worker = kthread_run(&flush_worker_fn, dc, "dm-delay-flush-worker"); in delay_ctr() 274 if (IS_ERR(dc->worker)) { in delay_ctr() 275 ret = PTR_ERR(dc->worker); in delay_ctr() 276 dc->worker = NULL; in delay_ctr() 324 wake_up_process(dc->worker); in delay_bio()
|
/linux/fs/erofs/ |
H A D | zdata.c | 343 struct kthread_worker *worker; in erofs_destroy_percpu_workers() local 350 if (worker) in erofs_destroy_percpu_workers() 361 if (IS_ERR(worker)) in erofs_init_percpu_worker() 362 return worker; in erofs_init_percpu_worker() 365 return worker; in erofs_init_percpu_worker() 380 if (!IS_ERR(worker)) in erofs_init_percpu_workers() 399 if (IS_ERR(worker)) in erofs_cpu_online() 400 return PTR_ERR(worker); in erofs_cpu_online() 424 if (worker) in erofs_cpu_offline() 1392 worker = rcu_dereference( in z_erofs_decompress_kickoff() [all …]
|