Changeset 6f13257 in mainline for uspace/srv/bd/hr/fge.c
- Timestamp:
- 2025-05-20T11:01:31Z (2 months ago)
- Children:
- c5b60e25
- Parents:
- a2281efc
- git-author:
- Miroslav Cimerman <mc@…> (2025-05-20 10:55:15)
- git-committer:
- Miroslav Cimerman <mc@…> (2025-05-20 11:01:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/fge.c
ra2281efc r6f13257 59 59 typedef struct wu_queue wu_queue_t; 60 60 61 static void 62 static void 63 static errno_t 64 static errno_t 65 static void 66 static void 67 static ssize_t 61 static void *hr_fpool_make_storage(hr_fpool_t *, ssize_t *); 62 static void hr_fpool_group_epilogue(hr_fpool_t *); 63 static errno_t fge_fibril(void *); 64 static errno_t wu_queue_init(wu_queue_t *, size_t); 65 static void wu_queue_push(wu_queue_t *, fge_fibril_data_t *); 66 static void wu_queue_pop(wu_queue_t *, fge_fibril_data_t *); 67 static ssize_t hr_fpool_get_free_slot(hr_fpool_t *); 68 68 69 69 struct fge_fibril_data { 70 hr_wu_t wu;/* work unit function pointer */71 void *arg;/* work unit function argument */72 hr_fgroup_t *group;/* back-pointer to group */73 ssize_t memslot;/* index to pool bitmap slot */70 hr_wu_t wu; /* work unit function pointer */ 71 void *arg; /* work unit function argument */ 72 hr_fgroup_t *group; /* back-pointer to group */ 73 ssize_t memslot; /* index to pool bitmap slot */ 74 74 }; 75 75 76 76 struct wu_queue { 77 fibril_mutex_t 78 fibril_condvar_t 79 fibril_condvar_t 80 fge_fibril_data_t *fexecs;/* circ-buf memory */77 fibril_mutex_t lock; 78 fibril_condvar_t not_empty; 79 fibril_condvar_t not_full; 80 fge_fibril_data_t *fexecs; /* circ-buf memory */ 81 81 circ_buf_t cbuf; 82 82 }; 83 83 84 84 struct hr_fpool { 85 fibril_mutex_t 86 bitmap_t bitmap;/* memory slot bitmap */87 wu_queue_t 88 fid_t 89 uint8_t *wu_storage;/* pre-allocated pool storage */90 size_t 91 size_t 92 size_t 93 bool 94 size_t 95 size_t 85 fibril_mutex_t lock; 86 bitmap_t bitmap; /* memory slot bitmap */ 87 wu_queue_t queue; 88 fid_t *fibrils; 89 uint8_t *wu_storage; /* pre-allocated pool storage */ 90 size_t fibril_cnt; 91 size_t max_wus; 92 size_t active_groups; 93 bool stop; 94 size_t wu_size; 95 size_t wu_storage_free_count; 96 96 fibril_condvar_t all_wus_done; 97 97 }; 98 98 99 99 struct hr_fgroup { 100 hr_fpool_t *pool;/* back-pointer to pool */101 size_t wu_cnt;/* upper bound of work units */102 size_t submitted;/* number of submitted jobs */103 size_t reserved_cnt;/* no. of reserved wu storage slots */104 size_t 105 size_t *memslots;/* indices to pool bitmap */106 void *own_mem;/* own allocated memory */107 size_t own_used;/* own memory slots used counter */108 errno_t final_errno;/* agreggated errno */109 size_t finished_okay;/* no. of wus that ended with EOK */110 size_t finished_fail;/* no. of wus that ended with != EOK */111 fibril_mutex_t 100 hr_fpool_t *pool;/* back-pointer to pool */ 101 size_t wu_cnt;/* upper bound of work units */ 102 size_t submitted; /* number of submitted jobs */ 103 size_t reserved_cnt; /* no. of reserved wu storage slots */ 104 size_t reserved_avail; 105 size_t *memslots; /* indices to pool bitmap */ 106 void *own_mem; /* own allocated memory */ 107 size_t own_used; /* own memory slots used counter */ 108 errno_t final_errno; /* agreggated errno */ 109 size_t finished_okay; /* no. of wus that ended with EOK */ 110 size_t finished_fail; /* no. of wus that ended with != EOK */ 111 fibril_mutex_t lock; 112 112 fibril_condvar_t all_done; 113 113 };
Note:
See TracChangeset
for help on using the changeset viewer.