Skip to content

Commit

Permalink
strip out completion counter from dbgi parsing layer
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfleury committed Nov 14, 2024
1 parent cefbd40 commit 6cf9b82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/dbgi/dbgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@ di_open(DI_Key *key)
{
di_u2p_enqueue_key(&key_normalized, max_U64);
ins_atomic_u64_eval_assign(&node->last_time_requested_us, os_now_microseconds());
ins_atomic_u64_inc_eval(&node->request_count);
DeferLoop(os_rw_mutex_drop_w(stripe->rw_mutex), os_rw_mutex_take_w(stripe->rw_mutex))
{
async_push_work(di_parse_work, .completion_counter = &node->completion_count);
async_push_work(di_parse_work);
}
}
}
Expand Down Expand Up @@ -613,15 +612,14 @@ di_rdi_from_key(DI_Scope *scope, DI_Key *key, U64 endt_us)
//- rjf: parse not done, not working -> ask for parse
if(node != 0 &&
!node->parse_done &&
(ins_atomic_u64_eval(&node->request_count) == ins_atomic_u64_eval(&node->completion_count) ||
ins_atomic_u64_eval(&node->last_time_requested_us)+100000 < os_now_microseconds()) &&
!ins_atomic_u64_eval(&node->is_working) &&
ins_atomic_u64_eval(&node->last_time_requested_us)+100000 < os_now_microseconds() &&
di_u2p_enqueue_key(&key_normalized, endt_us))
{
ins_atomic_u64_eval_assign(&node->last_time_requested_us, os_now_microseconds());
ins_atomic_u64_inc_eval(&node->request_count);
DeferLoop(os_rw_mutex_drop_r(stripe->rw_mutex), os_rw_mutex_take_r(stripe->rw_mutex))
{
async_push_work(di_parse_work, .completion_counter = &node->completion_count);
async_push_work(di_parse_work);
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/dbgi/dbgi.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ struct DI_Node
// rjf: metadata
U64 ref_count;
U64 touch_count;
U64 request_count;
U64 completion_count;
U64 is_working;
U64 last_time_requested_us;

Expand Down

0 comments on commit 6cf9b82

Please sign in to comment.