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 *
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 */
12
13#ifndef __TSE_SCHEDULE_H__
14#define __TSE_SCHEDULE_H__
15
16#include <gurt/list.h>
17
18#include <pthread.h>
19#include <inttypes.h>
20#include <stdbool.h>
21
23#define TSE_TASK_ARG_LEN (840 + sizeof(pthread_mutex_t))
25#define TSE_PRIV_SIZE (TSE_TASK_ARG_LEN + 136)
27#define TSE_TASK_SIZE (TSE_PRIV_SIZE + 8)
28
30 typedef struct tse_task {
32 int dt_result;
34 int dt_pad32;
36 struct {
37 char dt_space[TSE_PRIV_SIZE];
38 } dt_private;
39} tse_task_t;
40
42 typedef struct {
44 int ds_result;
45
47 void *ds_udata;
48
50 struct {
51 uint64_t ds_space[48];
52 } ds_private;
53} tse_sched_t;
54
56 typedef int (*tse_sched_comp_cb_t)(void *args, int rc);
58 typedef int (*tse_task_func_t)(tse_task_t *);
59
61 typedef int (*tse_task_cb_t)(tse_task_t *, void *arg);
62
64void *
65tse_task2arg(tse_task_t *task);
66
68 tse_sched_t *
69tse_task2sched(tse_task_t *task);
70
85int
86tse_sched_init(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb,
87 void *udata);
88
94void
95tse_sched_fini(tse_sched_t *sched);
96
102void
103tse_sched_addref(tse_sched_t *sched);
104
110void
111tse_sched_decref(tse_sched_t *sched);
112
121void
122tse_sched_complete(tse_sched_t *sched, int ret, bool cancel);
123
134int
135tse_sched_register_comp_cb(tse_sched_t *sched, tse_sched_comp_cb_t comp_cb, void *arg);
136
147void
148tse_sched_progress(tse_sched_t *sched);
149
157bool
158tse_sched_check_complete(tse_sched_t *sched);
159
181int
182tse_task_create(tse_task_func_t task_func, tse_sched_t *sched, void *priv,
183 tse_task_t **taskp);
184
196int
197tse_task_schedule(tse_task_t *task, bool instant);
198
209int
210tse_task_schedule_with_delay(tse_task_t *task, bool instant, uint64_t delay);
211
223int
224tse_task_register_comp_cb(tse_task_t *task, tse_task_cb_t comp_cb,
225 void *arg, size_t arg_size);
226
233void
234tse_task_complete(tse_task_t *task, int ret);
235
248void *
249tse_task_buf_embedded(tse_task_t *task, int size);
250
255void *
256tse_task_get_priv(tse_task_t *task);
257
262void *
263tse_task_set_priv(tse_task_t *task, void *priv);
264
277int
278tse_task_register_deps(tse_task_t *task, int num_deps,
279 tse_task_t *dep_tasks[]);
280
296int
297tse_task_register_cbs(tse_task_t *task, tse_task_cb_t prep_cb,
298 void *prep_data, size_t prep_data_size,
299 tse_task_cb_t comp_cb, void *comp_data,
300 size_t comp_data_size);
301
315int
316tse_task_reinit(tse_task_t *task);
317
328int
329tse_task_reinit_with_delay(tse_task_t *task, uint64_t delay);
330
344int
345tse_task_reset(tse_task_t *task, tse_task_func_t task_func, void *priv);
346
348void
349tse_task_addref(tse_task_t *task);
350
352void
353tse_task_decref(tse_task_t *task);
354
359int
360tse_task_list_add(tse_task_t *task, d_list_t *head);
361
365void
366tse_task_list_del(tse_task_t *task);
367
372 tse_task_t *
373tse_task_list_first(d_list_t *head);
374
378void
379tse_task_list_sched(d_list_t *head, bool instant);
380
384void
385tse_task_list_abort(d_list_t *head, int rc);
386
390int
391tse_task_list_depend(d_list_t *head, tse_task_t *task);
392
396int
397tse_task_depend_list(tse_task_t *task, d_list_t *head);
398
404int
405tse_task_list_traverse(d_list_t *head, tse_task_cb_t cb, void *arg);
406
411int
412tse_task_list_traverse_adv(d_list_t *head, tse_task_cb_t cb, void *arg);
413
417void
418tse_disable_propagate(tse_task_t *task);
419
420#endif /* __TSE_SCHEDULE_H__ */
tse_sched_t
Definition tse.h:42
tse_sched_t::ds_udata
void * ds_udata
Definition tse.h:47
tse_sched_t::ds_result
int ds_result
Definition tse.h:44
tse_task
Definition tse.h:30
tse_task::dt_private
struct tse_task::@351224144136166203356205063217050145066267354170 dt_private
tse_task::dt_result
int dt_result
Definition tse.h:32
tse_task::dt_pad32
int dt_pad32
Definition tse.h:34
tse_task_cb_t
int(* tse_task_cb_t)(tse_task_t *, void *arg)
Definition tse.h:61
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:56
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_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:25
tse_task_t
struct tse_task tse_task_t
tse_task_func_t
int(* tse_task_func_t)(tse_task_t *)
Definition tse.h:58
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)