switch from static lane distribution in file/dasm to dynamic counter

This commit is contained in:
Ryan Fleury
2025-09-18 14:19:00 -07:00
parent 7c08d6846b
commit 364e15491c
7 changed files with 68 additions and 40 deletions
+9 -2
View File
@@ -310,14 +310,20 @@ fs_tick(void)
arena_clear(fs_shared->req_arena);
fs_shared->first_req = fs_shared->last_req = 0;
fs_shared->req_count = 0;
fs_shared->lane_req_take_counter = 0;
}
lane_sync();
//- rjf: do requests
Rng1U64 range = lane_range(reqs_count);
for EachInRange(req_idx, range)
for(;;)
{
//- rjf: unpack
U64 req_num = ins_atomic_u64_inc_eval(&fs_shared->lane_req_take_counter);
if(req_num < 1 || reqs_count < req_num)
{
break;
}
U64 req_idx = req_num-1;
FS_Request *r = &reqs[req_idx];
HS_Key key = r->key;
String8 path = r->path;
@@ -394,6 +400,7 @@ fs_tick(void)
}
cond_var_broadcast(path_stripe->cv);
}
lane_sync();
scratch_end(scratch);
ProfEnd();
+3
View File
@@ -91,6 +91,9 @@ struct FS_Shared
FS_RequestNode *first_req;
FS_RequestNode *last_req;
U64 req_count;
// rjf: request take counter
U64 lane_req_take_counter;
};
////////////////////////////////