- Timestamp:
- Nov 19, 2021, 3:53:47 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 7ef162b2
- Parents:
- cd4c605
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
rcd4c605 r059ad16 133 133 } 134 134 135 void __cfa_io_flush( processor * proc) {135 bool __cfa_io_flush( processor * proc, bool wait ) { 136 136 /* paranoid */ verify( ! __preemption_enabled() ); 137 137 /* paranoid */ verify( proc ); … … 141 141 $io_context & ctx = *proc->io.ctx; 142 142 143 // for(i; 2) {144 // unsigned idx = proc->rdq.id + i;145 // cltr->ready_queue.lanes.tscs[idx].tv = -1ull;146 // }147 148 143 __ioarbiter_flush( ctx ); 149 144 150 145 __STATS__( true, io.calls.flush++; ) 151 int ret = syscall( __NR_io_uring_enter, ctx.fd, ctx.sq.to_submit, 0, 0, (sigset_t *)0p, _NSIG / 8);146 int ret = syscall( __NR_io_uring_enter, ctx.fd, ctx.sq.to_submit, wait ? 1 : 0, 0, (sigset_t *)0p, _NSIG / 8); 152 147 if( ret < 0 ) { 153 148 switch((int)errno) { … … 157 152 // Update statistics 158 153 __STATS__( false, io.calls.errors.busy ++; ) 159 // for(i; 2) { 160 // unsigned idx = proc->rdq.id + i; 161 // cltr->ready_queue.lanes.tscs[idx].tv = rdtscl(); 162 // } 163 return; 154 return false; 164 155 default: 165 156 abort( "KERNEL ERROR: IO_URING SYSCALL - (%d) %s\n", (int)errno, strerror(errno) ); … … 183 174 ctx.proc->io.pending = false; 184 175 185 __cfa_io_drain( proc ); 186 // for(i; 2) { 187 // unsigned idx = proc->rdq.id + i; 188 // cltr->ready_queue.lanes.tscs[idx].tv = rdtscl(); 189 // } 176 return __cfa_io_drain( proc ); 190 177 } 191 178 … … 315 302 if(sq.to_submit > 30 || !lazy) { 316 303 ready_schedule_lock(); 317 __cfa_io_flush( ctx->proc );304 __cfa_io_flush( ctx->proc, false ); 318 305 ready_schedule_unlock(); 319 306 } -
libcfa/src/concurrency/io/setup.cfa
rcd4c605 r059ad16 32 32 33 33 void __cfa_io_start( processor * proc ) {} 34 void __cfa_io_flush( processor * proc) {}34 bool __cfa_io_flush( processor * proc, bool ) {} 35 35 void __cfa_io_stop ( processor * proc ) {} 36 36 -
libcfa/src/concurrency/kernel.cfa
rcd4c605 r059ad16 130 130 extern void __cfa_io_start( processor * ); 131 131 extern bool __cfa_io_drain( processor * ); 132 extern void __cfa_io_flush( processor *);132 extern bool __cfa_io_flush( processor *, bool wait ); 133 133 extern void __cfa_io_stop ( processor * ); 134 134 static inline bool __maybe_io_drain( processor * ); … … 197 197 if( !readyThread ) { 198 198 ready_schedule_lock(); 199 __cfa_io_flush( this );199 __cfa_io_flush( this, false ); 200 200 ready_schedule_unlock(); 201 201 … … 251 251 if(this->io.pending && !this->io.dirty) { 252 252 ready_schedule_lock(); 253 __cfa_io_flush( this );253 __cfa_io_flush( this, false ); 254 254 ready_schedule_unlock(); 255 255 } … … 268 268 269 269 // If we can't find a thread, might as well flush any outstanding I/O 270 if(this->io.pending) { __cfa_io_flush( this ); }270 if(this->io.pending) { __cfa_io_flush( this, false ); } 271 271 272 272 // Spin a little on I/O, just in case … … 363 363 364 364 if(this->io.pending && !this->io.dirty) { 365 __cfa_io_flush( this );365 __cfa_io_flush( this, false ); 366 366 } 367 367 -
libcfa/src/concurrency/kernel_private.hfa
rcd4c605 r059ad16 39 39 } 40 40 41 // #define IO_URING_IDLE 42 41 43 //----------------------------------------------------------------------------- 42 44 // Scheduler … … 149 151 __atomic_store_n(ll, (bool)false, __ATOMIC_RELEASE); 150 152 } 151 152 153 154 155 153 156 154 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.