DAOS API: src/include/daos/tse.h Source File

| DAOS API (v2.1 - dev)

Loading...
Searching...
No Matches
tse.h
Go to the documentation of this file.
1/*
2 * (C) Copyright 2015-2024 Intel Corporation.
3 * (C) Copyright 2026 Hewlett Packard Enterprise Development LP
4 *
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
6 */
13
14#ifndef __TSE_SCHEDULE_H__
15#define __TSE_SCHEDULE_H__
16
17#include <gurt/list.h>
18
19#include <pthread.h>
20#include <inttypes.h>
21#include <stdbool.h>
22
24#define TSE_TASK_ARG_LEN (840 + sizeof(pthread_mutex_t))
26#define TSE_PRIV_SIZE (TSE_TASK_ARG_LEN + 136)
28#define TSE_TASK_SIZE (TSE_PRIV_SIZE + 8)
29
31 typedef struct tse_task {
33 int dt_result;
35 int dt_pad32;
37 struct {
38 char dt_space[TSE_PRIV_SIZE];
39 } dt_private;
40} tse_task_t;
41
43 typedef struct {
45 int ds_result;
46
48 void *ds_udata;
49
51 struct {
52 uint64_t ds_space[48];
53 } ds_private;
54} tse_sched_t;
55
57 typedef int (*tse_sched_comp_cb_t)(void *args, int rc);
59 typedef int (*tse_task_func_t)(tse_task_t *);
60
62 typedef int (*tse_task_cb_t)(tse_task_t *, void *arg);
63
65void *
66tse_task2arg(tse_task_t *task);
67
69 tse_sched_t *
70tse_task2sched(tse_task_t *task);
71
86int
87tse_sched_init(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb,
88 void *udata);
89
95void
96tse_sched_fini(tse_sched_t *sched);
97
103void
104tse_sched_addref(tse_sched_t *sched);
105
111void
112tse_sched_decref(tse_sched_t *sched);
113
122void
123tse_sched_complete(tse_sched_t *sched, int ret, bool cancel);
124
135int
136tse_sched_register_comp_cb(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb, void *arg);
137
148void
149tse_sched_progress(tse_sched_t *sched);
150
158bool
159tse_sched_check_complete(tse_sched_t *sched);
160
182int
183tse_task_create(tse_task_func_t task_func, tse_sched_t *sched, void *priv,
184 tse_task_t **taskp);
185
197int
198tse_task_schedule(tse_task_t *task, bool instant);
199
210int
211tse_task_schedule_with_delay(tse_task_t *task, bool instant, uint64_t delay);
212
224int
225tse_task_register_comp_cb(tse_task_t *task, tse_task_cb_t comp_cb,
226 void *arg, size_t arg_size);
227
242int
243tse_task_register_comp_cb_and_reinit(tse_task_t *task, tse_task_cb_t comp_cb, void *arg,
244 size_t arg_size, uint64_t delay);
245
252void
253tse_task_complete(tse_task_t *task, int ret);
254
267void *
268tse_task_buf_embedded(tse_task_t *task, int size);
269
274void *
275tse_task_get_priv(tse_task_t *task);
276
281void *
282tse_task_set_priv(tse_task_t *task, void *priv);
283
296int
297tse_task_register_deps(tse_task_t *task, int num_deps,
298 tse_task_t *dep_tasks[]);
299
315int
316tse_task_register_cbs(tse_task_t *task, tse_task_cb_t prep_cb,
317 void *prep_data, size_t prep_data_size,
318 tse_task_cb_t comp_cb, void *comp_data,
319 size_t comp_data_size);
320
334int
335tse_task_reinit(tse_task_t *task);
336
347int
348tse_task_reinit_with_delay(tse_task_t *task, uint64_t delay);
349
363int
364tse_task_reset(tse_task_t *task, tse_task_func_t task_func, void *priv);
365
367void
368tse_task_addref(tse_task_t *task);
369
371void
372tse_task_decref(tse_task_t *task);
373
378int
379tse_task_list_add(tse_task_t *task, d_list_t *head);
380
384void
385tse_task_list_del(tse_task_t *task);
386
391 tse_task_t *
392tse_task_list_first(d_list_t *head);
393
397void
398tse_task_list_sched(d_list_t *head, bool instant);
399
403void
404tse_task_list_abort(d_list_t *head, int rc);
405
409int
410tse_task_list_depend(d_list_t *head, tse_task_t *task);
411
415int
416tse_task_depend_list(tse_task_t *task, d_list_t *head);
417
423int
424tse_task_list_traverse(d_list_t *head, tse_task_cb_t cb, void *arg);
425
430int
431tse_task_list_traverse_adv(d_list_t *head, tse_task_cb_t cb, void *arg);
432
436void
437tse_disable_propagate(tse_task_t *task);
438
439#endif /* __TSE_SCHEDULE_H__ */
tse_sched_t
Definition tse.h:43
tse_sched_t::ds_udata
void * ds_udata
Definition tse.h:48
tse_sched_t::ds_result
int ds_result
Definition tse.h:45
tse_task
Definition tse.h:31
tse_task::dt_private
struct tse_task::@351224144136166203356205063217050145066267354170 dt_private
tse_task::dt_result
int dt_result
Definition tse.h:33
tse_task::dt_pad32
int dt_pad32
Definition tse.h:35
tse_task_cb_t
int(* tse_task_cb_t)(tse_task_t *, void *arg)
Definition tse.h:62
tse_task2sched
tse_sched_t * tse_task2sched(tse_task_t *task)
tse_sched_comp_cb_t
int(* tse_sched_comp_cb_t)(void *args, int rc)
Definition tse.h:57
tse_task_list_traverse_adv
int tse_task_list_traverse_adv(d_list_t *head, tse_task_cb_t cb, void *arg)
tse_task_register_comp_cb_and_reinit
int tse_task_register_comp_cb_and_reinit(tse_task_t *task, tse_task_cb_t comp_cb, void *arg, size_t arg_size, uint64_t delay)
tse_task_register_deps
int tse_task_register_deps(tse_task_t *task, int num_deps, tse_task_t *dep_tasks[])
TSE_PRIV_SIZE
#define TSE_PRIV_SIZE
Definition tse.h:26
tse_task_t
struct tse_task tse_task_t
tse_task_func_t
int(* tse_task_func_t)(tse_task_t *)
Definition tse.h:59
tse_sched_complete
void tse_sched_complete(tse_sched_t *sched, int ret, bool cancel)
tse_task_list_sched
void tse_task_list_sched(d_list_t *head, bool instant)
tse_task_list_depend
int tse_task_list_depend(d_list_t *head, tse_task_t *task)
tse_sched_addref
void tse_sched_addref(tse_sched_t *sched)
tse_task_addref
void tse_task_addref(tse_task_t *task)
tse_task_buf_embedded
void * tse_task_buf_embedded(tse_task_t *task, int size)
tse_task_set_priv
void * tse_task_set_priv(tse_task_t *task, void *priv)
tse_task_reinit
int tse_task_reinit(tse_task_t *task)
tse_task_register_cbs
int tse_task_register_cbs(tse_task_t *task, tse_task_cb_t prep_cb, void *prep_data, size_t prep_data_size, tse_task_cb_t comp_cb, void *comp_data, size_t comp_data_size)
tse_sched_decref
void tse_sched_decref(tse_sched_t *sched)
tse_task_register_comp_cb
int tse_task_register_comp_cb(tse_task_t *task, tse_task_cb_t comp_cb, void *arg, size_t arg_size)
tse_task_schedule_with_delay
int tse_task_schedule_with_delay(tse_task_t *task, bool instant, uint64_t delay)
tse_task_list_abort
void tse_task_list_abort(d_list_t *head, int rc)
tse_task_complete
void tse_task_complete(tse_task_t *task, int ret)
tse_task2arg
void * tse_task2arg(tse_task_t *task)
tse_sched_progress
void tse_sched_progress(tse_sched_t *sched)
tse_task_schedule
int tse_task_schedule(tse_task_t *task, bool instant)
tse_task_get_priv
void * tse_task_get_priv(tse_task_t *task)
tse_task_reinit_with_delay
int tse_task_reinit_with_delay(tse_task_t *task, uint64_t delay)
tse_task_depend_list
int tse_task_depend_list(tse_task_t *task, d_list_t *head)
tse_sched_register_comp_cb
int tse_sched_register_comp_cb(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb, void *arg)
tse_sched_init
int tse_sched_init(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb, void *udata)
tse_task_decref
void tse_task_decref(tse_task_t *task)
tse_sched_check_complete
bool tse_sched_check_complete(tse_sched_t *sched)
tse_task_list_first
tse_task_t * tse_task_list_first(d_list_t *head)
tse_task_create
int tse_task_create(tse_task_func_t task_func, tse_sched_t *sched, void *priv, tse_task_t **taskp)
tse_task_list_add
int tse_task_list_add(tse_task_t *task, d_list_t *head)
tse_disable_propagate
void tse_disable_propagate(tse_task_t *task)
tse_task_list_traverse
int tse_task_list_traverse(d_list_t *head, tse_task_cb_t cb, void *arg)
tse_task_reset
int tse_task_reset(tse_task_t *task, tse_task_func_t task_func, void *priv)
tse_sched_fini
void tse_sched_fini(tse_sched_t *sched)
tse_task_list_del
void tse_task_list_del(tse_task_t *task)