Changeset 7ce8873 for libcfa


Ignore:
Timestamp:
Jul 28, 2022, 12:03:16 PM (21 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
3f95dab
Parents:
e8616b6
Message:

Added some io stats

Location:
libcfa/src/concurrency
Files:
5 edited

Legend:

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

    re8616b6 r7ce8873  
    432432
    433433                disable_interrupts();
     434                __STATS__( true, if(!lazy) io.submit.eagr += 1; )
    434435                processor * proc = __cfaabi_tls.this_processor;
    435436                $io_context * ctx = proc->io.ctx;
  • libcfa/src/concurrency/io/call.cfa.in

    re8616b6 r7ce8873  
    3434#include "kernel.hfa"
    3535#include "io/types.hfa"
     36#include "stats.hfa"
    3637
    3738//=============================================================================================
     
    226227        async_{name}( future, {args}, submit_flags );
    227228
    228         wait( future );
     229        __attribute__((unused)) bool parked;
     230        parked = wait( future );
     231        __STATS__(false, if(!parked) io.submit.nblk += 1; )
    229232        if( future.result < 0 ) {{
    230233                errno = -future.result;
  • libcfa/src/concurrency/io/setup.cfa

    re8616b6 r7ce8873  
    229229                #if !defined(CFA_WITH_IO_URING_IDLE)
    230230                        // Step 4 : eventfd
    231                         // io_uring_register is so f*cking slow on some machine that it
    232                         // will never succeed if preemption isn't hard blocked
    233231                        __cfadbg_print_safe(io_core, "Kernel I/O : registering %d for completion with ring %d\n", procfd, fd);
    234232
     
    240238                        __cfadbg_print_safe(io_core, "Kernel I/O : registered %d for completion with ring %d\n", procfd, fd);
    241239                #endif
     240
     241                // #if defined(CFA_HAVE_IORING_REGISTER_IOWQ_MAX_WORKERS)
     242                //      // Step 5 : max worker count
     243                //      __cfadbg_print_safe(io_core, "Kernel I/O : lmiting max workers for ring %d\n", fd);
     244
     245                //      unsigned int maxes[2];
     246                //      maxes[0] = 64; // max number of bounded workers (Regular files / block)
     247                //      maxes[1] = 64;  // max number of unbounded workers (IOSQE_ASYNC)
     248                //      int ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_IOWQ_MAX_WORKERS, maxes, 2);
     249                //      if (ret < 0) {
     250                //              abort("KERNEL ERROR: IO_URING MAX WORKER REGISTER - %s\n", strerror(errno));
     251                //      }
     252
     253                //      __cfadbg_print_safe(io_core, "Kernel I/O : lmited max workers for ring %d\n", fd);
     254                // #endif
    242255
    243256                // some paranoid checks
  • libcfa/src/concurrency/stats.cfa

    re8616b6 r7ce8873  
    4646                        stats->io.submit.fast       = 0;
    4747                        stats->io.submit.slow       = 0;
     48                        stats->io.submit.eagr       = 0;
     49                        stats->io.submit.nblk       = 0;
    4850                        stats->io.flush.external    = 0;
    4951                        stats->io.flush.dirty       = 0;
     
    116118                        tally_one( &cltr->io.submit.fast      , &proc->io.submit.fast       );
    117119                        tally_one( &cltr->io.submit.slow      , &proc->io.submit.slow       );
     120                        tally_one( &cltr->io.submit.eagr      , &proc->io.submit.eagr       );
     121                        tally_one( &cltr->io.submit.nblk      , &proc->io.submit.nblk       );
    118122                        tally_one( &cltr->io.flush.external   , &proc->io.flush.external    );
    119123                        tally_one( &cltr->io.flush.dirty      , &proc->io.flush.dirty       );
     
    197201                                        sstr | "fast," | eng3(io.submit.slow) | "slow (" | ws(3, 3, avgfasts) | "%)" | nonl;
    198202                                }
     203                                sstr | " - eager" | eng3(io.submit.eagr) | nonl;
     204                                sstr | " - no-wait" | eng3(io.submit.nblk) | nonl;
    199205                                sstr | nl;
    200206
  • libcfa/src/concurrency/stats.hfa

    re8616b6 r7ce8873  
    9292                                volatile uint64_t fast;
    9393                                volatile uint64_t slow;
     94                                volatile uint64_t eagr;
     95                                volatile uint64_t nblk;
    9496                        } submit;
    9597                        struct {
Note: See TracChangeset for help on using the changeset viewer.