Changeset 78a580d for libcfa/src/concurrency/kernel
- Timestamp:
- Mar 22, 2022, 3:28:29 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- ff7b2de
- Parents:
- 8f01ad71
- Location:
- libcfa/src/concurrency/kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/cluster.cfa
r8f01ad71 r78a580d 27 27 28 28 #include "ready_subqueue.hfa" 29 #include "io/types.hfa" 29 30 30 31 #include <errno.h> … … 259 260 it->rdq.id = valrq; 260 261 it->rdq.target = MAX; 261 it->io. id = valio;262 it->io.ctx->cq.id = valio; 262 263 it->io.target = MAX; 263 264 valrq += __shard_factor.readyq; … … 278 279 while(it) { 279 280 /* paranoid */ verifyf( it, "Unexpected null iterator\n"); 280 /* paranoid */ verifyf( it->io. id < count, "Processor %p has id %u above count %zu\n", it, it->rdq.id, count);281 data[it->io. id] = it->io.ctx;281 /* paranoid */ verifyf( it->io.ctx->cq.id < count, "Processor %p has id %u above count %zu\n", it, it->rdq.id, count); 282 data[it->io.ctx->cq.id] = it->io.ctx; 282 283 it = &(*it)`next; 283 284 } -
libcfa/src/concurrency/kernel/cluster.hfa
r8f01ad71 r78a580d 16 16 #pragma once 17 17 18 #include "device/cpu.hfa" 18 19 #include "kernel/private.hfa" 20 21 #include "limits.hfa" 19 22 20 23 //----------------------------------------------------------------------- … … 31 34 const unsigned long long ret = ((new_weight * new_val) + (old_weight * old_avg)) / total_weight; 32 35 return ret; 36 } 37 38 static inline void touch_tsc(__timestamp_t * tscs, size_t idx, unsigned long long ts_prev, unsigned long long ts_next) { 39 if (ts_next == MAX) return; 40 unsigned long long now = rdtscl(); 41 unsigned long long pma = __atomic_load_n(&tscs[ idx ].ma, __ATOMIC_RELAXED); 42 __atomic_store_n(&tscs[ idx ].tv, ts_next, __ATOMIC_RELAXED); 43 __atomic_store_n(&tscs[ idx ].ma, moving_average(now, ts_prev, pma), __ATOMIC_RELAXED); 33 44 } 34 45 -
libcfa/src/concurrency/kernel/startup.cfa
r8f01ad71 r78a580d 233 233 /* paranoid */ verify( sizeof(storage_mainIdleEventFd) == sizeof(eventfd_t) ); 234 234 235 __cfa_io_start( mainProcessor ); 235 236 register_tls( mainProcessor ); 236 __cfa_io_start( mainProcessor );237 237 238 238 // Start by initializing the main thread … … 314 314 mainProcessor->local_data = 0p; 315 315 316 unregister_tls( mainProcessor ); 316 317 __cfa_io_stop( mainProcessor ); 317 unregister_tls( mainProcessor );318 318 319 319 // Destroy the main processor and its context in reverse order of construction … … 364 364 proc->local_data = &__cfaabi_tls; 365 365 366 __cfa_io_start( proc ); 366 367 register_tls( proc ); 367 368 __cfa_io_start( proc );369 368 370 369 // used for idle sleep when io_uring is present … … 401 400 // Main routine of the core returned, the core is now fully terminated 402 401 __cfadbg_print_safe(runtime_core, "Kernel : core %p main ended (%p)\n", proc, &proc->runner); 403 404 __cfa_io_stop( proc );405 402 406 403 #if !defined(__CFA_NO_STATISTICS__) … … 417 414 418 415 unregister_tls( proc ); 416 __cfa_io_stop( proc ); 419 417 420 418 return 0p;
Note:
See TracChangeset
for help on using the changeset viewer.