Changeset 262fafd9 for libcfa/src


Ignore:
Timestamp:
Mar 29, 2022, 4:27:52 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
6e47b49
Parents:
dfd3410
Message:

Added debugging information to help find deadlock.

Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

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

    rdfd3410 r262fafd9  
    680680                        __atomic_acquire( &proc->io.ctx->cq.lock );
    681681
     682                        __attribute__((used)) volatile bool was_reset = false;
     683
    682684                        with( proc->idle_wctx) {
    683685
     
    690692                                        iov.iov_len  = sizeof(eventfd_t);
    691693                                        __kernel_read(proc, *ftr, iov, evfd );
     694                                        ftr->result = 0xDEADDEAD;
     695                                        *((eventfd_t *)rdbuf) = 0xDEADDEADDEADDEAD;
     696                                        was_reset = true;
    692697                                }
    693698                        }
     
    695700                        if( !__atomic_load_n( &proc->do_terminate, __ATOMIC_SEQ_CST ) ) {
    696701                                __ioarbiter_flush( *proc->io.ctx );
     702                                proc->idle_wctx.sleep_time = rdtscl();
    697703                                ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
    698704                        }
     
    701707                        __cfa_do_drain( proc->io.ctx, proc->cltr );
    702708                        ready_schedule_unlock();
     709
     710                        asm volatile ("" :: "m" (was_reset));
    703711                }
    704712        #endif
  • libcfa/src/concurrency/kernel.cfa

    rdfd3410 r262fafd9  
    682682        this->idle_wctx.sem = 1;
    683683
     684        this->idle_wctx.wake_time = rdtscl();
     685
    684686        eventfd_t val;
    685687        val = 1;
  • libcfa/src/concurrency/kernel.hfa

    rdfd3410 r262fafd9  
    7474        // unused if not using io_uring for idle sleep
    7575        io_future_t * ftr;
     76
     77        volatile unsigned long long wake_time;
     78        volatile unsigned long long sleep_time;
    7679};
    7780
  • libcfa/src/concurrency/kernel/startup.cfa

    rdfd3410 r262fafd9  
    558558
    559559        idle_wctx.sem = 0;
     560        idle_wctx.wake_time = 0;
    560561
    561562        // I'm assuming these two are reserved for standard input and output
Note: See TracChangeset for help on using the changeset viewer.