Changes in / [ec19b21:b0f6190a]


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

Legend:

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

    rec19b21 rb0f6190a  
    314314        }
    315315
     316        extern void signal_block( int sig );
     317        extern void signal_unblock( int sig );
     318
    316319        static void __io_create( __io_data & this, const io_context_params & params_in ) {
    317320                // Step 1 : call to setup
     
    429432
    430433                // Step 4 : eventfd
    431                 int efd;
    432                 for() {
    433                         efd = eventfd(0, 0);
    434                         if (efd < 0) {
    435                                 if (errno == EINTR) continue;
    436                                 abort("KERNEL ERROR: IO_URING EVENTFD - %s\n", strerror(errno));
    437                         }
    438                         break;
    439                 }
    440 
    441                 int ret;
    442                 for() {
    443                         ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &efd, 1);
    444                         if (ret < 0) {
    445                                 if (errno == EINTR) continue;
    446                                 abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno));
    447                         }
    448                         break;
    449                 }
     434                // io_uring_register is so f*cking slow on some machine that it
     435                // will never succeed if preemption isn't hard blocked
     436                signal_block( SIGUSR1 );
     437
     438                int efd = eventfd(0, 0);
     439                if (efd < 0) {
     440                        abort("KERNEL ERROR: IO_URING EVENTFD - %s\n", strerror(errno));
     441                }
     442
     443                int ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &efd, 1);
     444                if (ret < 0) {
     445                        abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno));
     446                }
     447
     448                signal_unblock( SIGUSR1 );
    450449
    451450                // some paranoid checks
  • libcfa/src/concurrency/preemption.cfa

    rec19b21 rb0f6190a  
    394394
    395395// sigprocmask wrapper : unblock a single signal
    396 static inline void signal_unblock( int sig ) {
     396void signal_unblock( int sig ) {
    397397        sigset_t mask;
    398398        sigemptyset( &mask );
     
    405405
    406406// sigprocmask wrapper : block a single signal
    407 static inline void signal_block( int sig ) {
     407void signal_block( int sig ) {
    408408        sigset_t mask;
    409409        sigemptyset( &mask );
Note: See TracChangeset for help on using the changeset viewer.