Changeset 1e6ffb44 for libcfa/src/concurrency/io.cfa
- Timestamp:
- Mar 28, 2022, 5:55:48 PM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- ff55092
- Parents:
- 7425720
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
r7425720 r1e6ffb44 169 169 170 170 struct io_future_t * future = (struct io_future_t *)(uintptr_t)cqe.user_data; 171 __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", &cqe, cqe.res, future );171 // __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", &cqe, cqe.res, future ); 172 172 173 173 __kernel_unpark( fulfil( *future, cqe.res, false ), UNPARK_LOCAL ); 174 174 } 175 175 176 __cfadbg_print_safe(io, "Kernel I/O : %u completed\n", count);177 176 unsigned long long ts_next = ctx->cq.ts = rdtscl(); 178 177 … … 181 180 __atomic_store_n( ctx->cq.head, head + count, __ATOMIC_SEQ_CST ); 182 181 182 __cfadbg_print_safe(io, "Kernel I/O : %u completed age %llu\n", count, ts_next); 183 183 /* paranoid */ verify( ready_schedule_islocked() ); 184 184 /* paranoid */ verify( ! __preemption_enabled() ); … … 230 230 const unsigned long long cutoff = calc_cutoff(ctsc, ctx->cq.id, ctxs_count, io.data, io.tscs, __shard_factor.io); 231 231 const unsigned long long age = moving_average(ctsc, io.tscs[target].tv, io.tscs[target].ma); 232 // __cfadbg_print_safe(ready_queue, "Kernel: Help attempt on %u from %u, age %'llu vs cutoff %'llu, %s\n", target, this, age, cutoff, age > cutoff ? "yes" : "no");232 __cfadbg_print_safe(io, "Kernel I/O: Help attempt on %u from %u, age %'llu vs cutoff %'llu, %s\n", target, this, age, cutoff, age > cutoff ? "yes" : "no"); 233 233 if(age <= cutoff) break HELP; 234 234 … … 301 301 struct io_uring_sqe * sqes = ctx->sq.sqes; 302 302 for(i; want) { 303 __cfadbg_print_safe(io, "Kernel I/O : filling loop\n");303 // __cfadbg_print_safe(io, "Kernel I/O : filling loop\n"); 304 304 out_sqes[i] = &sqes[idxs[i]]; 305 305 } … … 319 319 // copy all the indexes we want from the available list 320 320 for(i; want) { 321 __cfadbg_print_safe(io, "Kernel I/O : allocating loop\n");321 // __cfadbg_print_safe(io, "Kernel I/O : allocating loop\n"); 322 322 idxs[i] = sq.free_ring.array[(fhead + i) & mask]; 323 323 } … … 336 336 // sqe == &sqes[idx] 337 337 struct $io_context * cfa_io_allocate(struct io_uring_sqe * sqes[], __u32 idxs[], __u32 want) { 338 __cfadbg_print_safe(io, "Kernel I/O : attempting to allocate %u\n", want);338 // __cfadbg_print_safe(io, "Kernel I/O : attempting to allocate %u\n", want); 339 339 340 340 disable_interrupts(); … … 344 344 /* paranoid */ verify( ctx ); 345 345 346 __cfadbg_print_safe(io, "Kernel I/O : attempting to fast allocation\n");346 // __cfadbg_print_safe(io, "Kernel I/O : attempting to fast allocation\n"); 347 347 348 348 // We can proceed to the fast path … … 352 352 enable_interrupts(); 353 353 354 __cfadbg_print_safe(io, "Kernel I/O : fast allocation successful from ring %d\n", ctx->fd);354 // __cfadbg_print_safe(io, "Kernel I/O : fast allocation successful from ring %d\n", ctx->fd); 355 355 356 356 __fill( sqes, want, idxs, ctx ); … … 367 367 /* paranoid */ verify( ioarb ); 368 368 369 __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for allocation\n");369 // __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for allocation\n"); 370 370 371 371 struct $io_context * ret = __ioarbiter_allocate(*ioarb, idxs, want); 372 372 373 __cfadbg_print_safe(io, "Kernel I/O : slow allocation completed from ring %d\n", ret->fd);373 // __cfadbg_print_safe(io, "Kernel I/O : slow allocation completed from ring %d\n", ret->fd); 374 374 375 375 __fill( sqes, want, idxs,ret ); … … 388 388 // Add the sqes to the array 389 389 for( i; have ) { 390 __cfadbg_print_safe(io, "Kernel I/O : __submit loop\n");390 // __cfadbg_print_safe(io, "Kernel I/O : __submit loop\n"); 391 391 sq.kring.array[ (tail + i) & mask ] = idxs[i]; 392 392 } … … 415 415 416 416 void cfa_io_submit( struct $io_context * inctx, __u32 idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1))) { 417 __cfadbg_print_safe(io, "Kernel I/O : attempting to submit %u (%s)\n", have, lazy ? "lazy" : "eager");417 // __cfadbg_print_safe(io, "Kernel I/O : attempting to submit %u (%s)\n", have, lazy ? "lazy" : "eager"); 418 418 419 419 disable_interrupts(); … … 432 432 enable_interrupts(); 433 433 434 __cfadbg_print_safe(io, "Kernel I/O : submitted on fast path\n");434 // __cfadbg_print_safe(io, "Kernel I/O : submitted on fast path\n"); 435 435 return; 436 436 } … … 440 440 enable_interrupts(); 441 441 442 __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for submission\n");442 // __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for submission\n"); 443 443 444 444 __ioarbiter_submit(inctx, idxs, have, lazy); … … 484 484 // go through the range and release the sqes 485 485 for( i; count ) { 486 __cfadbg_print_safe(io, "Kernel I/O : release loop\n");486 // __cfadbg_print_safe(io, "Kernel I/O : release loop\n"); 487 487 __u32 idx = ctx.sq.kring.array[ (phead + i) & mask ]; 488 488 ctx.sq.free_ring.array[ (ftail + i) & mask ] = idx; … … 524 524 525 525 static $io_context * __ioarbiter_allocate( $io_arbiter & this, __u32 idxs[], __u32 want ) { 526 __cfadbg_print_safe(io, "Kernel I/O : arbiter allocating\n");526 // __cfadbg_print_safe(io, "Kernel I/O : arbiter allocating\n"); 527 527 528 528 __STATS__( false, io.alloc.block += 1; )
Note: See TracChangeset
for help on using the changeset viewer.