Ignore:
Timestamp:
Mar 22, 2022, 3:28:29 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
ff7b2de
Parents:
8f01ad71
Message:

I/O now updates the timestamps when draining.
Timestamps are not used yet.

File:
1 edited

Legend:

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

    r8f01ad71 r78a580d  
    4242        #include "kernel/fwd.hfa"
    4343        #include "kernel/private.hfa"
     44        #include "kernel/cluster.hfa"
    4445        #include "io/types.hfa"
    4546
     
    9394        extern void __kernel_unpark( thread$ * thrd, unpark_hint );
    9495
    95         bool __cfa_io_drain( $io_context * ctx ) {
     96        bool __cfa_io_drain( $io_context * ctx, cluster * cltr ) {
    9697                /* paranoid */ verify( ! __preemption_enabled() );
    9798                /* paranoid */ verify( ready_schedule_islocked() );
     
    112113                }
    113114
     115                unsigned long long ts_prev = ctx->cq.ts;
     116
    114117                for(i; count) {
    115118                        unsigned idx = (head + i) & mask;
     
    125128
    126129                __cfadbg_print_safe(io, "Kernel I/O : %u completed\n", count);
     130                unsigned long long ts_next = ctx->cq.ts = rdtscl();
    127131
    128132                // Mark to the kernel that the cqe has been seen
     
    134138
    135139                __atomic_unlock(&ctx->cq.lock);
     140
     141                touch_tsc( cltr->sched.io.tscs, ctx->cq.id, ts_prev, ts_next );
    136142
    137143                return true;
     
    143149                /* paranoid */ verify( proc->io.ctx );
    144150
    145                 __attribute__((unused)) cluster * cltr = proc->cltr;
     151                cluster * cltr = proc->cltr;
    146152                $io_context & ctx = *proc->io.ctx;
    147153
     
    183189
    184190                ready_schedule_lock();
    185                 bool ret = __cfa_io_drain( &ctx );
     191                bool ret = __cfa_io_drain( &ctx, cltr );
    186192                ready_schedule_unlock();
    187193                return ret;
Note: See TracChangeset for help on using the changeset viewer.