Home
last modified time | relevance | path

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

12345

/Linux-v6.1/io_uring/
Dio-wq.c144 static void io_wqe_dec_running(struct io_worker *worker);
151 static bool io_worker_get(struct io_worker *worker) in io_worker_get() argument
153 return refcount_inc_not_zero(&worker->ref); in io_worker_get()
156 static void io_worker_release(struct io_worker *worker) in io_worker_release() argument
158 if (refcount_dec_and_test(&worker->ref)) in io_worker_release()
159 complete(&worker->ref_done); in io_worker_release()
173 static inline struct io_wqe_acct *io_wqe_get_acct(struct io_worker *worker) in io_wqe_get_acct() argument
175 return io_get_acct(worker->wqe, worker->flags & IO_WORKER_F_BOUND); in io_wqe_get_acct()
184 static void io_worker_cancel_cb(struct io_worker *worker) in io_worker_cancel_cb() argument
186 struct io_wqe_acct *acct = io_wqe_get_acct(worker); in io_worker_cancel_cb()
[all …]
/Linux-v6.1/kernel/
Dkthread.c756 void __kthread_init_worker(struct kthread_worker *worker, in __kthread_init_worker() argument
760 memset(worker, 0, sizeof(struct kthread_worker)); in __kthread_init_worker()
761 raw_spin_lock_init(&worker->lock); in __kthread_init_worker()
762 lockdep_set_class_and_name(&worker->lock, key, name); in __kthread_init_worker()
763 INIT_LIST_HEAD(&worker->work_list); in __kthread_init_worker()
764 INIT_LIST_HEAD(&worker->delayed_work_list); in __kthread_init_worker()
785 struct kthread_worker *worker = worker_ptr; in kthread_worker_fn() local
792 WARN_ON(worker->task && worker->task != current); in kthread_worker_fn()
793 worker->task = current; in kthread_worker_fn()
795 if (worker->flags & KTW_FREEZABLE) in kthread_worker_fn()
[all …]
Dworkqueue.c178 struct worker *manager; /* L: purely informational */
270 struct worker *rescuer; /* MD: rescue worker */
427 #define for_each_pool_worker(worker, pool) \ argument
428 list_for_each_entry((worker), &(pool)->workers, node) \
834 static struct worker *first_idle_worker(struct worker_pool *pool) in first_idle_worker()
839 return list_first_entry(&pool->idle_list, struct worker, entry); in first_idle_worker()
853 struct worker *worker = first_idle_worker(pool); in wake_up_worker() local
855 if (likely(worker)) in wake_up_worker()
856 wake_up_process(worker->task); in wake_up_worker()
867 struct worker *worker = kthread_data(task); in wq_worker_running() local
[all …]
Dasync.c301 struct worker *worker = current_wq_worker(); in current_is_async() local
303 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-v6.1/tools/perf/bench/
Dfutex-hash.c43 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()
185 if (!worker[i].futex) in bench_futex_hash()
196 ret = pthread_create(&worker[i].thread, &thread_attr, workerfn, in bench_futex_hash()
197 (void *)(struct worker *) &worker[i]); in bench_futex_hash()
[all …]
Depoll-wait.c118 struct worker { struct
186 struct worker *w = (struct worker *) arg; in workerfn()
240 static void nest_epollfd(struct worker *w) in nest_epollfd()
292 static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) in do_threads() argument
318 struct worker *w = &worker[i]; in do_threads()
366 (void *)(struct worker *) w); in do_threads()
382 struct worker *worker = p; in writerfn() local
394 shuffle((void *)worker, nthreads, sizeof(*worker)); in writerfn()
398 struct worker *w = &worker[i]; in writerfn()
421 struct worker *w1 = (struct worker *) p1; in cmpworker()
[all …]
Dfutex-lock-pi.c27 struct worker { struct
35 static struct worker *worker; argument
84 struct worker *w = (struct worker *) arg; in workerfn()
121 static void create_threads(struct worker *w, pthread_attr_t thread_attr, in create_threads()
136 worker[i].tid = i; in create_threads()
139 worker[i].futex = calloc(1, sizeof(u_int32_t)); in create_threads()
140 if (!worker[i].futex) in create_threads()
143 worker[i].futex = &global_futex; in create_threads()
153 if (pthread_create(&w[i].thread, &thread_attr, workerfn, &worker[i])) { in create_threads()
190 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_lock_pi()
[all …]
Depoll-ctl.c67 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 …]
Dfutex-wake.c36 static pthread_t *worker; variable
167 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_wake()
168 if (!worker) in bench_futex_wake()
191 block_threads(worker, thread_attr, cpu); in bench_futex_wake()
220 ret = pthread_join(worker[i], NULL); in bench_futex_wake()
235 free(worker); in bench_futex_wake()
Dfutex-requeue.c36 static pthread_t *worker; variable
192 worker = calloc(params.nthreads, sizeof(*worker)); in bench_futex_requeue()
193 if (!worker) in bench_futex_requeue()
222 block_threads(worker, thread_attr, cpu); in bench_futex_requeue()
294 ret = pthread_join(worker[i], NULL); in bench_futex_requeue()
308 free(worker); in bench_futex_requeue()
/Linux-v6.1/include/linux/
Dkthread.h134 struct kthread_worker *worker; member
162 extern void __kthread_init_worker(struct kthread_worker *worker,
165 #define kthread_init_worker(worker) \ argument
168 __kthread_init_worker((worker), "("#worker")->lock", &__key); \
196 bool kthread_queue_work(struct kthread_worker *worker,
199 bool kthread_queue_delayed_work(struct kthread_worker *worker,
203 bool kthread_mod_delayed_work(struct kthread_worker *worker,
208 void kthread_flush_worker(struct kthread_worker *worker);
213 void kthread_destroy_worker(struct kthread_worker *worker);
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-v6.1/drivers/net/wireguard/
Dqueueing.c13 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()
34 queue->worker = wg_packet_percpu_multicore_worker_alloc(function, queue); in wg_packet_queue_init()
35 if (!queue->worker) { in wg_packet_queue_init()
44 free_percpu(queue->worker); in wg_packet_queue_free()
/Linux-v6.1/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-v6.1/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-v6.1/drivers/gpu/drm/msm/
Dmsm_atomic.c118 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()
Dmsm_io_utils.c106 kthread_queue_work(work->worker, &work->work); in msm_hrtimer_worktimer()
119 struct kthread_worker *worker, in msm_hrtimer_work_init() argument
126 work->worker = worker; in msm_hrtimer_work_init()
/Linux-v6.1/drivers/thermal/intel/
Dintel_powerclamp.c73 struct kthread_worker *worker; member
387 kthread_queue_delayed_work(w_data->worker, in clamp_balancing_func()
419 kthread_queue_work(w_data->worker, &w_data->balancing_work); in clamp_idle_injection_func()
462 struct kthread_worker *worker; in start_power_clamp_worker() local
464 worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inj/%ld", cpu); in start_power_clamp_worker()
465 if (IS_ERR(worker)) in start_power_clamp_worker()
468 w_data->worker = worker; in start_power_clamp_worker()
473 sched_set_fifo(worker->task); in start_power_clamp_worker()
477 kthread_queue_work(w_data->worker, &w_data->balancing_work); in start_power_clamp_worker()
484 if (!w_data->worker) in stop_power_clamp_worker()
[all …]
/Linux-v6.1/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-v6.1/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-v6.1/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()
359 INIT_WORK(&bigben->worker, bigben_worker); in bigben_probe()
400 schedule_work(&bigben->worker); in bigben_probe()
/Linux-v6.1/drivers/block/
Dloop.c834 struct loop_worker *cur_worker, *worker = NULL; in loop_queue_work() local
849 worker = cur_worker; in loop_queue_work()
857 if (worker) in loop_queue_work()
860 worker = kzalloc(sizeof(struct loop_worker), GFP_NOWAIT | __GFP_NOWARN); in loop_queue_work()
865 if (!worker) { in loop_queue_work()
873 worker->blkcg_css = cmd->blkcg_css; in loop_queue_work()
874 css_get(worker->blkcg_css); in loop_queue_work()
875 INIT_WORK(&worker->work, loop_workfn); in loop_queue_work()
876 INIT_LIST_HEAD(&worker->cmd_list); in loop_queue_work()
877 INIT_LIST_HEAD(&worker->idle_list); in loop_queue_work()
[all …]
/Linux-v6.1/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()

12345