Ignore:
Timestamp:
Apr 24, 2021, 9:05:30 PM (9 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
adaee12
Parents:
28d426a
Message:

I/O drain now keeps the schedlock for the duration of the call.
(Rather than locking/unlocking for each thread).

File:
1 edited

Legend:

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

    r28d426a re9c0b4c  
    551551// Scheduler routines
    552552// KERNEL ONLY
    553 void __schedule_thread( $thread * thrd ) {
     553static void __schedule_thread( $thread * thrd ) {
    554554        /* paranoid */ verify( ! __preemption_enabled() );
    555555        /* paranoid */ verify( kernelTLS().this_proc_id );
     
    659659}
    660660
     661void __kernel_unpark( $thread * thrd ) {
     662        /* paranoid */ verify( ! __preemption_enabled() );
     663        /* paranoid */ verify( ready_schedule_islocked());
     664
     665        if( !thrd ) return;
     666
     667        if(__must_unpark(thrd)) {
     668                // Wake lost the race,
     669                __schedule_thread( thrd );
     670        }
     671
     672        /* paranoid */ verify( ready_schedule_islocked());
     673        /* paranoid */ verify( ! __preemption_enabled() );
     674}
     675
    661676void unpark( $thread * thrd ) {
    662677        if( !thrd ) return;
     
    871886
    872887static inline bool __maybe_io_drain( processor * proc ) {
     888        bool ret = false;
    873889        #if defined(CFA_HAVE_LINUX_IO_URING_H)
    874890                __cfadbg_print_safe(runtime_core, "Kernel : core %p checking io for ring %d\n", proc, proc->io.ctx->fd);
     
    879895                unsigned tail = *ctx->cq.tail;
    880896                if(head == tail) return false;
    881                 return __cfa_io_drain( proc );
     897                ret = __cfa_io_drain( proc );
    882898        #endif
     899        return ret;
    883900}
    884901
Note: See TracChangeset for help on using the changeset viewer.