Changes in / [e716aec:93e0603]


Ignore:
Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

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

    re716aec r93e0603  
    8585        static io_context$ * __ioarbiter_allocate( io_arbiter$ & this, __u32 idxs[], __u32 want );
    8686        static void __ioarbiter_submit( io_context$ * , __u32 idxs[], __u32 have, bool lazy );
    87         static void __ioarbiter_flush ( io_context$ &, bool kernel );
     87        static void __ioarbiter_flush ( io_context$ & );
    8888        static inline void __ioarbiter_notify( io_context$ & ctx );
    8989//=============================================================================================
     
    9494        extern void __kernel_unpark( thread$ * thrd, unpark_hint );
    9595
    96         static inline void __post(oneshot & this, bool kernel, unpark_hint hint) {
    97                 thread$ * t = post( this, false );
    98                 if(kernel) __kernel_unpark( t, hint );
    99                 else unpark( t, hint );
    100         }
    101 
    102         // actual system call of io uring
    103         // wrap so everything that needs to happen around it is always done
    104         //   i.e., stats, book keeping, sqe reclamation, etc.
    10596        static void ioring_syscsll( struct io_context$ & ctx, unsigned int min_comp, unsigned int flags ) {
    10697                __STATS__( true, io.calls.flush++; )
    10798                int ret;
    10899                for() {
    109                         // do the system call in a loop, repeat on interrupts
    110100                        ret = syscall( __NR_io_uring_enter, ctx.fd, ctx.sq.to_submit, min_comp, flags, (sigset_t *)0p, _NSIG / 8);
    111101                        if( ret < 0 ) {
     
    130120                /* paranoid */ verify( ctx.sq.to_submit >= ret );
    131121
    132                 // keep track of how many still need submitting
    133                 __atomic_fetch_sub(&ctx.sq.to_submit, ret, __ATOMIC_SEQ_CST);
     122                ctx.sq.to_submit -= ret;
    134123
    135124                /* paranoid */ verify( ctx.sq.to_submit <= *ctx.sq.num );
     
    140129                /* paranoid */ verify( ! __preemption_enabled() );
    141130
    142                 // mark that there is no pending io left
    143131                __atomic_store_n(&ctx.proc->io.pending, false, __ATOMIC_RELAXED);
    144132        }
    145133
    146         // try to acquire an io context for draining, helping means we never *need* to drain, we can always do it later
    147134        static bool try_acquire( io_context$ * ctx ) __attribute__((nonnull(1))) {
    148135                /* paranoid */ verify( ! __preemption_enabled() );
     
    151138
    152139                {
    153                         // if there is nothing to drain there is no point in acquiring anything
    154140                        const __u32 head = *ctx->cq.head;
    155141                        const __u32 tail = *ctx->cq.tail;
     
    158144                }
    159145
    160                 // try a simple spinlock acquire, it's likely there are completions to drain
    161                 if(!__atomic_try_acquire(&ctx->cq.try_lock)) {
    162                         // some other processor already has it
     146                // Drain the queue
     147                if(!__atomic_try_acquire(&ctx->cq.lock)) {
    163148                        __STATS__( false, io.calls.locked++; )
    164149                        return false;
    165150                }
    166151
    167                 // acquired!!
    168152                return true;
    169153        }
    170154
    171         // actually drain the completion
    172155        static bool __cfa_do_drain( io_context$ * ctx, cluster * cltr ) __attribute__((nonnull(1, 2))) {
    173156                /* paranoid */ verify( ! __preemption_enabled() );
    174157                /* paranoid */ verify( ready_schedule_islocked() );
    175                 /* paranoid */ verify( ctx->cq.try_lock == true );
    176 
    177                 // get all the invariants and initial state
     158                /* paranoid */ verify( ctx->cq.lock == true );
     159
    178160                const __u32 mask = *ctx->cq.mask;
    179161                const __u32 num  = *ctx->cq.num;
     
    184166                for() {
    185167                        // re-read the head and tail in case it already changed.
    186                         // count the difference between the two
    187168                        const __u32 head = *ctx->cq.head;
    188169                        const __u32 tail = *ctx->cq.tail;
     
    190171                        __STATS__( false, io.calls.drain++; io.calls.completed += count; )
    191172
    192                         // for everything between head and tail, drain it
    193173                        for(i; count) {
    194174                                unsigned idx = (head + i) & mask;
     
    197177                                /* paranoid */ verify(&cqe);
    198178
    199                                 // find the future in the completion
    200179                                struct io_future_t * future = (struct io_future_t *)(uintptr_t)cqe.user_data;
    201180                                // __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", &cqe, cqe.res, future );
    202181
    203                                 // don't directly fulfill the future, preemption is disabled so we need to use kernel_unpark
    204182                                __kernel_unpark( fulfil( *future, cqe.res, false ), UNPARK_LOCAL );
    205183                        }
    206184
    207                         // update the timestamps accordingly
    208                         // keep a local copy so we can update the relaxed copy
    209185                        ts_next = ctx->cq.ts = rdtscl();
    210186
     
    214190                        ctx->proc->idle_wctx.drain_time = ts_next;
    215191
    216                         // we finished draining the completions... unless the ring buffer was full and there are more secret completions in the kernel.
    217192                        if(likely(count < num)) break;
    218193
    219                         // the ring buffer was full, there could be more stuff in the kernel.
    220194                        ioring_syscsll( *ctx, 0, IORING_ENTER_GETEVENTS);
    221195                }
     
    225199                /* paranoid */ verify( ! __preemption_enabled() );
    226200
    227                 // everything is drained, we can release the lock
    228                 __atomic_unlock(&ctx->cq.try_lock);
    229 
    230                 // update the relaxed timestamp
     201                __atomic_unlock(&ctx->cq.lock);
     202
    231203                touch_tsc( cltr->sched.io.tscs, ctx->cq.id, ts_prev, ts_next, false );
    232204
     
    234206        }
    235207
    236         // call from a processor to flush
    237         // contains all the bookkeeping a proc must do, not just the barebones flushing logic
    238         void __cfa_do_flush( io_context$ & ctx, bool kernel ) {
    239                 /* paranoid */ verify( ! __preemption_enabled() );
    240 
    241                 // flush any external requests
    242                 ctx.sq.last_external = false; // clear the external bit, the arbiter will reset it if needed
    243                 __ioarbiter_flush( ctx, kernel );
    244 
    245                 // if submitting must be submitted, do the system call
    246                 if(ctx.sq.to_submit != 0) {
    247                         ioring_syscsll(ctx, 0, 0);
    248                 }
    249         }
    250 
    251         // call from a processor to drain
    252         // contains all the bookkeeping a proc must do, not just the barebones draining logic
    253208        bool __cfa_io_drain( struct processor * proc ) {
    254209                bool local = false;
    255210                bool remote = false;
    256211
    257                 // make sure no ones creates/destroys io contexts
    258212                ready_schedule_lock();
    259213
     
    263217                /* paranoid */ verify( ctx );
    264218
    265                 // Help if needed
    266219                with(cltr->sched) {
    267220                        const size_t ctxs_count = io.count;
     
    277230                        const unsigned long long ctsc = rdtscl();
    278231
    279                         // only help once every other time
    280                         // pick a target when not helping
    281232                        if(proc->io.target == UINT_MAX) {
    282233                                uint64_t chaos = __tls_rand();
    283                                 // choose who to help and whether to accept helping far processors
    284234                                unsigned ext = chaos & 0xff;
    285235                                unsigned other  = (chaos >> 8) % (ctxs_count);
    286236
    287                                 // if the processor is on the same cache line or is lucky ( 3 out of 256 odds ) help it
    288237                                if(ext < 3 || __atomic_load_n(&caches[other / __shard_factor.io].id, __ATOMIC_RELAXED) == this_cache) {
    289238                                        proc->io.target = other;
     
    291240                        }
    292241                        else {
    293                                 // a target was picked last time, help it
    294242                                const unsigned target = proc->io.target;
    295243                                /* paranoid */ verify( io.tscs[target].t.tv != ULLONG_MAX );
    296                                 // make sure the target hasn't stopped existing since last time
    297244                                HELP: if(target < ctxs_count) {
    298                                         // calculate it's age and how young it could be before we give ip on helping
    299245                                        const __readyQ_avg_t cutoff = calc_cutoff(ctsc, ctx->cq.id, ctxs_count, io.data, io.tscs, __shard_factor.io, false);
    300246                                        const __readyQ_avg_t age = moving_average(ctsc, io.tscs[target].t.tv, io.tscs[target].t.ma, false);
    301247                                        __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");
    302                                         // is the target older than the cutoff, recall 0 is oldest and bigger ints are younger
    303248                                        if(age <= cutoff) break HELP;
    304249
    305                                         // attempt to help the submission side
    306                                         __cfa_do_flush( *io.data[target], true );
    307 
    308                                         // attempt to help the completion side
    309                                         if(!try_acquire(io.data[target])) break HELP; // already acquire no help needed
    310 
    311                                         // actually help
     250                                        if(!try_acquire(io.data[target])) break HELP;
     251
    312252                                        if(!__cfa_do_drain( io.data[target], cltr )) break HELP;
    313253
    314                                         // track we did help someone
    315254                                        remote = true;
    316255                                        __STATS__( true, io.calls.helped++; )
    317256                                }
    318 
    319                                 // reset the target
    320257                                proc->io.target = UINT_MAX;
    321258                        }
    322259                }
     260
    323261
    324262                // Drain the local queue
     
    332270
    333271                ready_schedule_unlock();
    334 
    335                 // return true if some completion entry, local or remote, was drained
    336272                return local || remote;
    337273        }
    338274
    339 
    340 
    341         // call from a processor to flush
    342         // contains all the bookkeeping a proc must do, not just the barebones flushing logic
    343275        bool __cfa_io_flush( struct processor * proc ) {
    344276                /* paranoid */ verify( ! __preemption_enabled() );
     
    346278                /* paranoid */ verify( proc->io.ctx );
    347279
    348                 __cfa_do_flush( *proc->io.ctx, false );
    349 
    350                 // also drain since some stuff will immediately complete
     280                io_context$ & ctx = *proc->io.ctx;
     281
     282                __ioarbiter_flush( ctx );
     283
     284                if(ctx.sq.to_submit != 0) {
     285                        ioring_syscsll(ctx, 0, 0);
     286
     287                }
     288
    351289                return __cfa_io_drain( proc );
    352290        }
     
    455393        //=============================================================================================
    456394        // submission
    457         // barebones logic to submit a group of sqes
    458         static inline void __submit_only( struct io_context$ * ctx, __u32 idxs[], __u32 have, bool lock) {
    459                 if(!lock)
    460                         lock( ctx->ext_sq.lock __cfaabi_dbg_ctx2 );
     395        static inline void __submit_only( struct io_context$ * ctx, __u32 idxs[], __u32 have) {
    461396                // We can proceed to the fast path
    462397                // Get the right objects
     
    473408                // Make the sqes visible to the submitter
    474409                __atomic_store_n(sq.kring.tail, tail + have, __ATOMIC_RELEASE);
    475                 __atomic_fetch_add(&sq.to_submit, have, __ATOMIC_SEQ_CST);
    476 
    477                 // set the bit to mark things need to be flushed
     410                sq.to_submit += have;
     411
    478412                __atomic_store_n(&ctx->proc->io.pending, true, __ATOMIC_RELAXED);
    479413                __atomic_store_n(&ctx->proc->io.dirty  , true, __ATOMIC_RELAXED);
    480 
    481                 if(!lock)
    482                         unlock( ctx->ext_sq.lock );
    483         }
    484 
    485         // submission logic + maybe flushing
     414        }
     415
    486416        static inline void __submit( struct io_context$ * ctx, __u32 idxs[], __u32 have, bool lazy) {
    487417                __sub_ring_t & sq = ctx->sq;
    488                 __submit_only(ctx, idxs, have, false);
     418                __submit_only(ctx, idxs, have);
    489419
    490420                if(sq.to_submit > 30) {
     
    498428        }
    499429
    500         // call from a processor to flush
    501         // might require arbitration if the thread was migrated after the allocation
    502430        void cfa_io_submit( struct io_context$ * inctx, __u32 idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1))) libcfa_public {
    503431                // __cfadbg_print_safe(io, "Kernel I/O : attempting to submit %u (%s)\n", have, lazy ? "lazy" : "eager");
     
    513441                if( ctx == inctx )              // We have the right instance?
    514442                {
    515                         // yes! fast submit
    516443                        __submit(ctx, idxs, have, lazy);
    517444
     
    580507                __atomic_store_n(&ctx.sq.free_ring.tail, ftail + count, __ATOMIC_SEQ_CST);
    581508
    582                 // notify the allocator that new allocations can be made
    583509                __ioarbiter_notify(ctx);
    584510
     
    631557        }
    632558
    633         // notify the arbiter that new allocations are available
    634559        static void __ioarbiter_notify( io_arbiter$ & this, io_context$ * ctx ) {
    635560                /* paranoid */ verify( !empty(this.pending.queue) );
    636                 /* paranoid */ verify( __preemption_enabled() );
    637 
    638                 // mutual exclusion is needed
     561
    639562                lock( this.pending.lock __cfaabi_dbg_ctx2 );
    640563                {
    641                         __cfadbg_print_safe(io, "Kernel I/O : notifying\n");
    642 
    643                         // as long as there are pending allocations try to satisfy them
    644                         // for simplicity do it in FIFO order
    645564                        while( !empty(this.pending.queue) ) {
    646                                 // get first pending allocs
     565                                __cfadbg_print_safe(io, "Kernel I/O : notifying\n");
    647566                                __u32 have = ctx->sq.free_ring.tail - ctx->sq.free_ring.head;
    648567                                __pending_alloc & pa = (__pending_alloc&)head( this.pending.queue );
    649568
    650                                 // check if we have enough to satisfy the request
    651569                                if( have > pa.want ) goto DONE;
    652 
    653                                 // if there are enough allocations it means we can drop the request
    654570                                drop( this.pending.queue );
    655571
    656572                                /* paranoid */__attribute__((unused)) bool ret =
    657573
    658                                 // actually do the alloc
    659574                                __alloc(ctx, pa.idxs, pa.want);
    660575
    661576                                /* paranoid */ verify( ret );
    662577
    663                                 // write out which context statisfied the request and post
    664                                 // this
    665578                                pa.ctx = ctx;
     579
    666580                                post( pa.waitctx );
    667581                        }
     
    671585                }
    672586                unlock( this.pending.lock );
    673 
    674                 /* paranoid */ verify( __preemption_enabled() );
    675         }
    676 
    677         // short hand to avoid the mutual exclusion of the pending is empty regardless
     587        }
     588
    678589        static void __ioarbiter_notify( io_context$ & ctx ) {
    679                 if(empty( ctx.arbiter->pending )) return;
    680                 __ioarbiter_notify( *ctx.arbiter, &ctx );
    681         }
    682 
    683         // Submit from outside the local processor: append to the outstanding list
     590                if(!empty( ctx.arbiter->pending )) {
     591                        __ioarbiter_notify( *ctx.arbiter, &ctx );
     592                }
     593        }
     594
     595        // Simply append to the pending
    684596        static void __ioarbiter_submit( io_context$ * ctx, __u32 idxs[], __u32 have, bool lazy ) {
    685597                __cfadbg_print_safe(io, "Kernel I/O : submitting %u from the arbiter to context %u\n", have, ctx->fd);
     
    687599                __cfadbg_print_safe(io, "Kernel I/O : waiting to submit %u\n", have);
    688600
    689                 // create the intrusive object to append
    690601                __external_io ei;
    691602                ei.idxs = idxs;
     
    693604                ei.lazy = lazy;
    694605
    695                 // enqueue the io
    696606                bool we = enqueue(ctx->ext_sq, (__outstanding_io&)ei);
    697607
    698                 // mark pending
    699608                __atomic_store_n(&ctx->proc->io.pending, true, __ATOMIC_SEQ_CST);
    700609
    701                 // if this is the first to be enqueued, signal the processor in an attempt to speed up flushing
    702                 // if it's not the first enqueue, a signal is already in transit
    703610                if( we ) {
    704611                        sigval_t value = { PREEMPT_IO };
    705612                        __cfaabi_pthread_sigqueue(ctx->proc->kernel_thread, SIGUSR1, value);
    706                         __STATS__( false, io.flush.signal += 1; )
    707                 }
    708                 __STATS__( false, io.submit.extr += 1; )
    709 
    710                 // to avoid dynamic allocation/memory reclamation headaches, wait for it to have been submitted
     613                }
     614
    711615                wait( ei.waitctx );
    712616
     
    714618        }
    715619
    716         // flush the io arbiter: move all external io operations to the submission ring
    717         static void __ioarbiter_flush( io_context$ & ctx, bool kernel ) {
    718                 // if there are no external operations just return
    719                 if(empty( ctx.ext_sq )) return;
    720 
    721                 // stats and logs
    722                 __STATS__( false, io.flush.external += 1; )
    723                 __cfadbg_print_safe(io, "Kernel I/O : arbiter flushing\n");
    724 
    725                 // this can happen from multiple processors, mutual exclusion is needed
    726                 lock( ctx.ext_sq.lock __cfaabi_dbg_ctx2 );
    727                 {
    728                         // pop each operation one at a time.
    729                         // There is no wait morphing because of the io sq ring
    730                         while( !empty(ctx.ext_sq.queue) ) {
    731                                 // drop the element from the queue
    732                                 __external_io & ei = (__external_io&)drop( ctx.ext_sq.queue );
    733 
    734                                 // submit it
    735                                 __submit_only(&ctx, ei.idxs, ei.have, true);
    736 
    737                                 // wake the thread that was waiting on it
    738                                 // since this can both be called from kernel and user, check the flag before posting
    739                                 __post( ei.waitctx, kernel, UNPARK_LOCAL );
     620        static void __ioarbiter_flush( io_context$ & ctx ) {
     621                if(!empty( ctx.ext_sq )) {
     622                        __STATS__( false, io.flush.external += 1; )
     623
     624                        __cfadbg_print_safe(io, "Kernel I/O : arbiter flushing\n");
     625
     626                        lock( ctx.ext_sq.lock __cfaabi_dbg_ctx2 );
     627                        {
     628                                while( !empty(ctx.ext_sq.queue) ) {
     629                                        __external_io & ei = (__external_io&)drop( ctx.ext_sq.queue );
     630
     631                                        __submit_only(&ctx, ei.idxs, ei.have);
     632
     633                                        post( ei.waitctx );
     634                                }
     635
     636                                ctx.ext_sq.empty = true;
    740637                        }
    741 
    742                         // mark the queue as empty
    743                         ctx.ext_sq.empty = true;
    744                         ctx.sq.last_external = true;
    745                 }
    746                 unlock(ctx.ext_sq.lock );
    747         }
    748 
    749         extern "C" {
    750                 // debug functions used for gdb
    751                 // io_uring doesn't yet support gdb soe the kernel-shared data structures aren't viewable in gdb
    752                 // these functions read the data that gdb can't and should be removed once the support is added
    753                 static __u32 __cfagdb_cq_head( io_context$ * ctx ) __attribute__((nonnull(1),used,noinline)) { return *ctx->cq.head; }
    754                 static __u32 __cfagdb_cq_tail( io_context$ * ctx ) __attribute__((nonnull(1),used,noinline)) { return *ctx->cq.tail; }
    755                 static __u32 __cfagdb_cq_mask( io_context$ * ctx ) __attribute__((nonnull(1),used,noinline)) { return *ctx->cq.mask; }
    756                 static __u32 __cfagdb_sq_head( io_context$ * ctx ) __attribute__((nonnull(1),used,noinline)) { return *ctx->sq.kring.head; }
    757                 static __u32 __cfagdb_sq_tail( io_context$ * ctx ) __attribute__((nonnull(1),used,noinline)) { return *ctx->sq.kring.tail; }
    758                 static __u32 __cfagdb_sq_mask( io_context$ * ctx ) __attribute__((nonnull(1),used,noinline)) { return *ctx->sq.mask; }
    759 
    760                 // fancier version that reads an sqe and copies it out.
    761                 static struct io_uring_sqe __cfagdb_sq_at( io_context$ * ctx, __u32 at ) __attribute__((nonnull(1),used,noinline)) {
    762                         __u32 ax = at & *ctx->sq.mask;
    763                         __u32 ix = ctx->sq.kring.array[ax];
    764                         return ctx->sq.sqes[ix];
     638                        unlock(ctx.ext_sq.lock );
    765639                }
    766640        }
  • libcfa/src/concurrency/io/setup.cfa

    re716aec r93e0603  
    216216
    217217                // completion queue
    218                 cq.try_lock  = false;
     218                cq.lock      = false;
    219219                cq.id        = MAX;
    220220                cq.ts        = rdtscl();
  • libcfa/src/concurrency/io/types.hfa

    re716aec r93e0603  
    3737        //-----------------------------------------------------------------------
    3838        // Ring Data structure
    39         // represent the io_uring submission ring which contains operations that will be sent to io_uring for processing
    40         struct __sub_ring_t {
    41                 // lock needed because remote processors might need to flush the instance
    42                 __spinlock_t lock;
    43 
     39      struct __sub_ring_t {
    4440                struct {
    4541                        // Head and tail of the ring (associated with array)
     
    6258
    6359                // number of sqes to submit on next system call.
    64                 volatile __u32 to_submit;
     60                __u32 to_submit;
    6561
    6662                // number of entries and mask to go with it
     
    8177                void * ring_ptr;
    8278                size_t ring_sz;
    83 
    84                 // for debug purposes, whether or not the last flush was due to a arbiter flush
    85                 bool last_external;
    8679        };
    8780
    88         // represent the io_uring completion ring which contains operations that have completed
    8981        struct __cmp_ring_t {
    90                 // needed because remote processors can help drain the buffer
    91                 volatile bool try_lock;
     82                volatile bool lock;
    9283
    93                 // id of the ring, used for the helping/topology algorithms
    9484                unsigned id;
    9585
    96                 // timestamp from last time it was drained
    9786                unsigned long long ts;
    9887
     
    116105        };
    117106
    118         // struct representing an io operation that still needs processing
    119         // actual operations are expected to inherit from this
    120107        struct __outstanding_io {
    121                 // intrusive link fields
    122108                inline Colable;
    123 
    124                 // primitive on which to block until the io is processed
    125109                oneshot waitctx;
    126110        };
    127111        static inline __outstanding_io *& Next( __outstanding_io * n ) { return (__outstanding_io *)Next( (Colable *)n ); }
    128112
    129         // queue of operations that are outstanding
    130113        struct __outstanding_io_queue {
    131                 // spinlock for protection
    132                 // TODO: changing to a lock that blocks, I haven't examined whether it should be a kernel or user lock
    133114                __spinlock_t lock;
    134 
    135                 // the actual queue
    136115                Queue(__outstanding_io) queue;
    137 
    138                 // volatile used to avoid the need for taking the lock if it's empty
    139116                volatile bool empty;
    140117        };
    141118
    142         // struct representing an operation that was submitted
    143119        struct __external_io {
    144                 // inherits from outstanding io
    145120                inline __outstanding_io;
    146 
    147                 // pointer and count to an array of ids to be submitted
    148121                __u32 * idxs;
    149122                __u32 have;
    150 
    151                 // whether or not these can be accumulated before flushing the buffer
    152123                bool lazy;
    153124        };
    154125
    155         // complete io_context, contains all the data for io submission and completion
     126
    156127        struct __attribute__((aligned(64))) io_context$ {
    157                 // arbiter, used in cases where threads for migrated at unfortunate moments
    158128                io_arbiter$ * arbiter;
    159 
    160                 // which prcessor the context is tied to
    161129                struct processor * proc;
    162130
    163                 // queue of io submissions that haven't beeen processed.
    164131                __outstanding_io_queue ext_sq;
    165132
    166                 // io_uring ring data structures
    167133                struct __sub_ring_t sq;
    168134                struct __cmp_ring_t cq;
    169 
    170                 // flag the io_uring rings where created with
    171135                __u32 ring_flags;
    172 
    173                 // file descriptor that identifies the io_uring instance
    174136                int fd;
    175137        };
    176138
    177         // short hand to check when the io_context was last processed (io drained)
    178139        static inline unsigned long long ts(io_context$ *& this) {
    179140                const __u32 head = *this->cq.head;
    180141                const __u32 tail = *this->cq.tail;
    181142
    182                 // if there is no pending completions, just pretend it's infinetely recent
    183143                if(head == tail) return ULLONG_MAX;
    184144
     
    186146        }
    187147
    188         // structure represeting allocations that couldn't succeed locally
    189148        struct __pending_alloc {
    190                 // inherit from outstanding io
    191149                inline __outstanding_io;
    192 
    193                 // array and size of the desired allocation
    194150                __u32 * idxs;
    195151                __u32 want;
    196 
    197                 // output param, the context the io was allocated from
    198152                io_context$ * ctx;
    199153        };
    200154
    201         // arbiter that handles cases where the context tied to the local processor is unable to satisfy the io
    202155        monitor __attribute__((aligned(64))) io_arbiter$ {
    203                 // contains a queue of io for pending allocations
    204156                __outstanding_io_queue pending;
    205157        };
  • libcfa/src/concurrency/kernel.cfa

    re716aec r93e0603  
    258258                __cfadbg_print_safe(runtime_core, "Kernel : core %p stopping\n", this);
    259259        }
    260 
    261         __cfa_io_flush( this );
    262         __cfa_io_drain( this );
    263260
    264261        post( this->terminated );
Note: See TracChangeset for help on using the changeset viewer.