Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    r262fafd9 redf247b  
    230230                                        const unsigned long long cutoff = calc_cutoff(ctsc, ctx->cq.id, ctxs_count, io.data, io.tscs, __shard_factor.io);
    231231                                        const unsigned long long age = moving_average(ctsc, io.tscs[target].tv, io.tscs[target].ma);
    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");
     232                                        __cfadbg_print_safe(io, "Kernel I/O: Help attempt on %u from %u, age %'llu vs cutoff %'llu, %s\n", target, ctx->cq.id, age, cutoff, age > cutoff ? "yes" : "no");
    233233                                        if(age <= cutoff) break HELP;
    234234
     
    635635
    636636                        // We can proceed to the fast path
    637                         if( !__alloc(ctx, &idx, 1) ) {
    638                                 /* paranoid */ verify( false ); // for now check if this happens, next time just abort the sleep.
    639                                 return false;
    640                         }
     637                        if( !__alloc(ctx, &idx, 1) ) return false;
    641638
    642639                        // Allocation was successful
     
    668665
    669666                        /* paranoid */ verify( sqe->user_data == (uintptr_t)&future );
    670                         __submit_only( ctx, &idx, 1 );
     667                        __submit( ctx, &idx, 1, true );
    671668
    672669                        /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
     
    679676                        iovec iov;
    680677                        __atomic_acquire( &proc->io.ctx->cq.lock );
    681 
    682                         __attribute__((used)) volatile bool was_reset = false;
    683678
    684679                        with( proc->idle_wctx) {
     
    692687                                        iov.iov_len  = sizeof(eventfd_t);
    693688                                        __kernel_read(proc, *ftr, iov, evfd );
    694                                         ftr->result = 0xDEADDEAD;
    695                                         *((eventfd_t *)rdbuf) = 0xDEADDEADDEADDEAD;
    696                                         was_reset = true;
    697689                                }
    698690                        }
    699691
    700                         if( !__atomic_load_n( &proc->do_terminate, __ATOMIC_SEQ_CST ) ) {
    701                                 __ioarbiter_flush( *proc->io.ctx );
    702                                 proc->idle_wctx.sleep_time = rdtscl();
    703                                 ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
    704                         }
     692                        __ioarbiter_flush( *proc->io.ctx );
     693                        ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
    705694
    706695                        ready_schedule_lock();
    707696                        __cfa_do_drain( proc->io.ctx, proc->cltr );
    708697                        ready_schedule_unlock();
    709 
    710                         asm volatile ("" :: "m" (was_reset));
    711698                }
    712699        #endif
Note: See TracChangeset for help on using the changeset viewer.