Home
last modified time | relevance | path

Searched refs:worker (Results 1 – 25 of 101) sorted by relevance

12345

/Linux-v5.15/kernel/
Dkthread.c695 void __kthread_init_worker(struct kthread_worker *worker, in __kthread_init_worker() argument
699 memset(worker, 0, sizeof(struct kthread_worker)); in __kthread_init_worker()
700 raw_spin_lock_init(&worker->lock); in __kthread_init_worker()
701 lockdep_set_class_and_name(&worker->lock, key, name); in __kthread_init_worker()
702 INIT_LIST_HEAD(&worker->work_list); in __kthread_init_worker()
703 INIT_LIST_HEAD(&worker->delayed_work_list); in __kthread_init_worker()
724 struct kthread_worker *worker = worker_ptr; in kthread_worker_fn() local
731 WARN_ON(worker->task && worker->task != current); in kthread_worker_fn()
732 worker->task = current; in kthread_worker_fn()
734 if (worker->flags & KTW_FREEZABLE) in kthread_worker_fn()
[all …]
Dworkqueue.c170 struct worker *manager; /* L: purely informational */
269 struct worker *rescuer; /* MD: rescue worker */
425 #define for_each_pool_worker(worker, pool) \ argument
426 list_for_each_entry((worker), &(pool)->workers, node) \
833 static struct worker *first_idle_worker(struct worker_pool *pool) in first_idle_worker()
838 return list_first_entry(&pool->idle_list, struct worker, entry); in first_idle_worker()
852 struct worker *worker = first_idle_worker(pool); in wake_up_worker() local
854 if (likely(worker)) in wake_up_worker()
855 wake_up_process(worker->task); in wake_up_worker()
866 struct worker *worker = kthread_data(task); in wq_worker_running() local
[all …]
Dasync.c304 struct worker *worker = current_wq_worker(); in current_is_async() local
306 return worker && worker->current_func == async_run_entry_fn; in current_is_async()
Dworkqueue_internal.h24 struct worker { struct
66 static inline struct worker *current_wq_worker(void) in current_wq_worker()
/Linux-v5.15/fs/
Dio-wq.c139 static void io_wqe_dec_running(struct io_worker *worker);
144 static bool io_worker_get(struct io_worker *worker) in io_worker_get() argument
146 return refcount_inc_not_zero(&worker->ref); in io_worker_get()
149 static void io_worker_release(struct io_worker *worker) in io_worker_release() argument
151 if (refcount_dec_and_test(&worker->ref)) in io_worker_release()
152 complete(&worker->ref_done); in io_worker_release()
166 static inline struct io_wqe_acct *io_wqe_get_acct(struct io_worker *worker) in io_wqe_get_acct() argument
168 return io_get_acct(worker->wqe, worker->flags & IO_WORKER_F_BOUND); in io_wqe_get_acct()
177 static void io_worker_exit(struct io_worker *worker) in io_worker_exit() argument
179 struct io_wqe *wqe = worker->wqe; in io_worker_exit()
[all …]
/Linux-v5.15/include/linux/
Dkthread.h106 struct kthread_worker *worker; member
116 #define KTHREAD_WORKER_INIT(worker) { \ argument
117 .lock = __RAW_SPIN_LOCK_UNLOCKED((worker).lock), \
118 .work_list = LIST_HEAD_INIT((worker).work_list), \
119 .delayed_work_list = LIST_HEAD_INIT((worker).delayed_work_list),\
133 #define DEFINE_KTHREAD_WORKER(worker) \ argument
134 struct kthread_worker worker = KTHREAD_WORKER_INIT(worker)
148 # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ argument
149 ({ kthread_init_worker(&worker); worker; })
150 # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ argument
[all …]
Ddevm-helpers.h48 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-v5.15/tools/perf/bench/
Dfutex-hash.c42 struct worker { struct
72 struct worker *w = (struct worker *) arg; in workerfn()
129 struct worker *worker = NULL; in bench_futex_hash() local
155 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_hash()
156 if (!worker) in bench_futex_hash()
174 worker[i].tid = i; in bench_futex_hash()
175 worker[i].futex = calloc(params.nfutexes, sizeof(*worker[i].futex)); in bench_futex_hash()
176 if (!worker[i].futex) in bench_futex_hash()
186 ret = pthread_create(&worker[i].thread, &thread_attr, workerfn, in bench_futex_hash()
187 (void *)(struct worker *) &worker[i]); in bench_futex_hash()
[all …]
Depoll-wait.c117 struct worker { struct
185 struct worker *w = (struct worker *) arg; in workerfn()
239 static void nest_epollfd(struct worker *w) in nest_epollfd()
291 static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) in do_threads() argument
310 struct worker *w = &worker[i]; in do_threads()
355 (void *)(struct worker *) w); in do_threads()
368 struct worker *worker = p; in writerfn() local
380 shuffle((void *)worker, nthreads, sizeof(*worker)); in writerfn()
384 struct worker *w = &worker[i]; in writerfn()
407 struct worker *w1 = (struct worker *) p1; in cmpworker()
[all …]
Dfutex-lock-pi.c26 struct worker { struct
34 static struct worker *worker; argument
83 struct worker *w = (struct worker *) arg; in workerfn()
120 static void create_threads(struct worker *w, pthread_attr_t thread_attr, in create_threads()
129 worker[i].tid = i; in create_threads()
132 worker[i].futex = calloc(1, sizeof(u_int32_t)); in create_threads()
133 if (!worker[i].futex) in create_threads()
136 worker[i].futex = &global_futex; in create_threads()
144 if (pthread_create(&w[i].thread, &thread_attr, workerfn, &worker[i])) in create_threads()
178 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_lock_pi()
[all …]
Depoll-ctl.c66 struct worker { struct
131 static inline void do_epoll_op(struct worker *w, int op, int fd) in do_epoll_op()
159 static inline void do_random_epoll_op(struct worker *w) in do_random_epoll_op()
173 struct worker *w = (struct worker *) arg; in workerfn()
203 static void init_fdmaps(struct worker *w, int pct) in init_fdmaps()
222 static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) in do_threads() argument
233 struct worker *w = &worker[i]; in do_threads()
266 (void *)(struct worker *) w); in do_threads()
303 struct worker *worker = NULL; in bench_epoll_ctl() local
338 worker = calloc(nthreads, sizeof(*worker)); in bench_epoll_ctl()
[all …]
Dfutex-wake.c35 static pthread_t *worker; variable
156 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_wake()
157 if (!worker) in bench_futex_wake()
180 block_threads(worker, thread_attr, cpu); in bench_futex_wake()
209 ret = pthread_join(worker[i], NULL); in bench_futex_wake()
224 free(worker); in bench_futex_wake()
Dfutex-requeue.c35 static pthread_t *worker; variable
180 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_requeue()
181 if (!worker) in bench_futex_requeue()
210 block_threads(worker, thread_attr, cpu); in bench_futex_requeue()
282 ret = pthread_join(worker[i], NULL); in bench_futex_requeue()
296 free(worker); in bench_futex_requeue()
/Linux-v5.15/drivers/net/wireguard/
Dqueueing.c12 struct multicore_worker __percpu *worker = alloc_percpu(struct multicore_worker); in wg_packet_percpu_multicore_worker_alloc() local
14 if (!worker) in wg_packet_percpu_multicore_worker_alloc()
18 per_cpu_ptr(worker, cpu)->ptr = ptr; in wg_packet_percpu_multicore_worker_alloc()
19 INIT_WORK(&per_cpu_ptr(worker, cpu)->work, function); in wg_packet_percpu_multicore_worker_alloc()
21 return worker; in wg_packet_percpu_multicore_worker_alloc()
33 queue->worker = wg_packet_percpu_multicore_worker_alloc(function, queue); in wg_packet_queue_init()
34 if (!queue->worker) { in wg_packet_queue_init()
43 free_percpu(queue->worker); in wg_packet_queue_free()
/Linux-v5.15/drivers/gpu/drm/
Ddrm_vblank_work.c60 kthread_queue_work(vblank->worker, &work->base); in drm_handle_vblank_works()
147 ret = kthread_queue_work(vblank->worker, &work->base); in drm_vblank_work_schedule()
251 struct kthread_worker *worker; in drm_vblank_worker_init() local
255 worker = kthread_create_worker(0, "card%d-crtc%d", in drm_vblank_worker_init()
258 if (IS_ERR(worker)) in drm_vblank_worker_init()
259 return PTR_ERR(worker); in drm_vblank_worker_init()
261 vblank->worker = worker; in drm_vblank_worker_init()
263 sched_set_fifo(worker->task); in drm_vblank_worker_init()
Ddrm_flip_work.c110 queue_work(wq, &work->worker); in drm_flip_work_commit()
116 struct drm_flip_work *work = container_of(w, struct drm_flip_work, worker); in flip_worker()
156 INIT_WORK(&work->worker, flip_worker); in drm_flip_work_init()
/Linux-v5.15/Documentation/core-api/
Dworkqueue.rst20 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
80 Special purpose threads, called worker threads, execute the functions
82 worker threads become idle. These worker threads are managed in so
[all …]
/Linux-v5.15/samples/seccomp/
Duser-trap.c204 pid_t worker = 0 , tracer = 0; in main() local
211 worker = fork(); in main()
212 if (worker < 0) { in main()
217 if (worker == 0) { in main()
343 if (waitpid(worker, &status, 0) != worker) { in main()
368 if (worker > 0) in main()
369 kill(worker, SIGKILL); in main()
/Linux-v5.15/drivers/gpu/drm/msm/
Dmsm_atomic.c124 kthread_queue_work(timer->worker, &timer->work); in msm_atomic_pending_timer()
145 timer->worker = kthread_create_worker(0, "atomic-worker-%d", crtc_idx); in msm_atomic_init_pending_timer()
146 if (IS_ERR(timer->worker)) { in msm_atomic_init_pending_timer()
147 int ret = PTR_ERR(timer->worker); in msm_atomic_init_pending_timer()
148 timer->worker = NULL; in msm_atomic_init_pending_timer()
151 sched_set_fifo(timer->worker->task); in msm_atomic_init_pending_timer()
159 if (timer->worker) in msm_atomic_destroy_pending_timer()
160 kthread_destroy_worker(timer->worker); in msm_atomic_destroy_pending_timer()
/Linux-v5.15/drivers/thermal/intel/
Dintel_powerclamp.c74 struct kthread_worker *worker; member
402 kthread_queue_delayed_work(w_data->worker, in clamp_balancing_func()
434 kthread_queue_work(w_data->worker, &w_data->balancing_work); in clamp_idle_injection_func()
477 struct kthread_worker *worker; in start_power_clamp_worker() local
479 worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inj/%ld", cpu); in start_power_clamp_worker()
480 if (IS_ERR(worker)) in start_power_clamp_worker()
483 w_data->worker = worker; in start_power_clamp_worker()
488 sched_set_fifo(worker->task); in start_power_clamp_worker()
492 kthread_queue_work(w_data->worker, &w_data->balancing_work); in start_power_clamp_worker()
499 if (!w_data->worker) in stop_power_clamp_worker()
[all …]
/Linux-v5.15/drivers/i2c/
Di2c-slave-testunit.c43 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-v5.15/drivers/hid/
Dhid-bigbenff.c184 struct work_struct worker; member
191 struct bigben_device, worker); in bigben_worker()
248 schedule_work(&bigben->worker); in hid_bigben_play_effect()
280 schedule_work(&bigben->worker); in bigben_set_led()
312 cancel_work_sync(&bigben->worker); in bigben_remove()
353 INIT_WORK(&bigben->worker, bigben_worker); in bigben_probe()
394 schedule_work(&bigben->worker); in bigben_probe()
/Linux-v5.15/drivers/block/
Dloop.c1002 struct loop_worker *cur_worker, *worker = NULL; in loop_queue_work() local
1017 worker = cur_worker; in loop_queue_work()
1025 if (worker) in loop_queue_work()
1028 worker = kzalloc(sizeof(struct loop_worker), GFP_NOWAIT | __GFP_NOWARN); in loop_queue_work()
1033 if (!worker) { in loop_queue_work()
1041 worker->blkcg_css = cmd->blkcg_css; in loop_queue_work()
1042 css_get(worker->blkcg_css); in loop_queue_work()
1043 INIT_WORK(&worker->work, loop_workfn); in loop_queue_work()
1044 INIT_LIST_HEAD(&worker->cmd_list); in loop_queue_work()
1045 INIT_LIST_HEAD(&worker->idle_list); in loop_queue_work()
[all …]
/Linux-v5.15/drivers/crypto/caam/
Dcaamrng.c41 struct work_struct worker; member
141 worker); in caam_rng_worker()
159 schedule_work(&ctx->worker); in caam_read()
168 flush_work(&ctx->worker); in caam_cleanup()
192 INIT_WORK(&ctx->worker, caam_rng_worker); in caam_init()
/Linux-v5.15/tools/testing/selftests/bpf/prog_tests/
Dsend_signal_sched_switch.c18 static void *worker(void *p) in worker() function
49 err = pthread_create(threads + i, NULL, worker, NULL); in test_send_signal_sched_switch()

12345