Changeset df7597e0
- Timestamp:
- Jun 17, 2021, 10:32:53 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 07b4970
- Parents:
- cf85f96
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rcf85f96 rdf7597e0 256 256 /* paranoid */ verify(cpu * READYQ_SHARD_FACTOR < lanes.count); 257 257 258 const int start = cpu * READYQ_SHARD_FACTOR; 258 const cpu_map_entry_t & map = cpu_info.llc_map[cpu]; 259 /* paranoid */ verify(map.start * READYQ_SHARD_FACTOR < lanes.count); 260 /* paranoid */ verify(map.self * READYQ_SHARD_FACTOR < lanes.count); 261 /* paranoid */ verifyf((map.start + map.count) * READYQ_SHARD_FACTOR <= lanes.count, "have %u lanes but map can go up to %u", lanes.count, (map.start + map.count) * READYQ_SHARD_FACTOR); 262 263 const int start = map.self * READYQ_SHARD_FACTOR; 259 264 unsigned i; 260 265 do { … … 288 293 const int cpu = __kernel_getcpu(); 289 294 /* paranoid */ verify(cpu >= 0); 295 /* paranoid */ verify(cpu < cpu_info.hthrd_count); 290 296 /* paranoid */ verify(cpu * READYQ_SHARD_FACTOR < lanes.count); 291 /* paranoid */ verify(cpu < cpu_info.hthrd_count); 297 298 const cpu_map_entry_t & map = cpu_info.llc_map[cpu]; 299 /* paranoid */ verify(map.start * READYQ_SHARD_FACTOR < lanes.count); 300 /* paranoid */ verify(map.self * READYQ_SHARD_FACTOR < lanes.count); 301 /* paranoid */ verifyf((map.start + map.count) * READYQ_SHARD_FACTOR <= lanes.count, "have %u lanes but map can go up to %u", lanes.count, (map.start + map.count) * READYQ_SHARD_FACTOR); 292 302 293 303 processor * const proc = kernelTLS().this_processor; 294 const int start = cpu* READYQ_SHARD_FACTOR;304 const int start = map.self * READYQ_SHARD_FACTOR; 295 305 296 306 // Did we already have a help target … … 303 313 } 304 314 proc->rdq.cutoff = min; 305 proc->rdq.target = __tls_rand() % lanes.count;315 proc->rdq.target = (map.start * READYQ_SHARD_FACTOR) + (__tls_rand() % (map.count* READYQ_SHARD_FACTOR)); 306 316 } 307 317 else {
Note: See TracChangeset
for help on using the changeset viewer.