mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-08 23:08:08 +00:00
eliminate incorrect cases of async_push_work, where pushes which could occur on worker threads may try to write to a cache that is currently being held, when the push occurs (when all threads are saturated) - async_push_work must never be called from within a cache locking mechanism
This commit is contained in:
@@ -1445,7 +1445,9 @@ ctrl_stored_hash_from_process_vaddr_range(CTRL_Handle process, Rng1U64 range, B3
|
||||
//- rjf: not good, or is stale -> submit hash request
|
||||
if((!is_good || is_stale) && os_now_microseconds() >= last_time_requested_us+100000)
|
||||
{
|
||||
if(ctrl_u2ms_enqueue_req(process, range, zero_terminated, endt_us)) OS_MutexScopeW(process_stripe->rw_mutex)
|
||||
if(ctrl_u2ms_enqueue_req(process, range, zero_terminated, endt_us))
|
||||
{
|
||||
OS_MutexScopeW(process_stripe->rw_mutex)
|
||||
{
|
||||
for(CTRL_ProcessMemoryCacheNode *n = process_slot->first; n != 0; n = n->next)
|
||||
{
|
||||
@@ -1463,6 +1465,7 @@ ctrl_stored_hash_from_process_vaddr_range(CTRL_Handle process, Rng1U64 range, B3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async_push_work(ctrl_mem_stream_work);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,11 +493,14 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
@@ -616,8 +619,11 @@ di_rdi_from_key(DI_Scope *scope, DI_Key *key, U64 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_w(stripe->rw_mutex), os_rw_mutex_take_w(stripe->rw_mutex))
|
||||
{
|
||||
async_push_work(di_parse_work, .completion_counter = &node->completion_count);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: time expired -> break
|
||||
if(os_now_microseconds() >= endt_us)
|
||||
|
||||
@@ -152,8 +152,11 @@ fs_hash_from_path_range(String8 path, Rng1U64 range, U64 endt_us)
|
||||
{
|
||||
ins_atomic_u64_eval_assign(&range_node->last_time_requested_us, os_now_microseconds());
|
||||
ins_atomic_u64_inc_eval(&range_node->request_count);
|
||||
DeferLoop(os_rw_mutex_drop_w(path_stripe->rw_mutex), os_rw_mutex_take_w(path_stripe->rw_mutex))
|
||||
{
|
||||
async_push_work(fs_stream_work, .completion_counter = &range_node->completion_count);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: try to reobtain results
|
||||
result = hs_hash_from_key(key, 0);
|
||||
|
||||
Reference in New Issue
Block a user