Changeset dd4e2d7


Ignore:
Timestamp:
May 8, 2020, 2:42:15 PM (17 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
6c12fd2
Parents:
0335620
Message:

Added option to change the length of the array of ready sqe

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/readv.cfa

    r0335620 rdd4e2d7  
    5959        unsigned long int nthreads = 2;
    6060        unsigned long int nprocs   = 1;
    61         int flags = 0;
     61        unsigned flags = 0;
     62        unsigned sublen = 16;
    6263
    6364        arg_loop:
     
    7071                        {"userthread",   no_argument      , 0, 'u'},
    7172                        {"submitthread", no_argument      , 0, 's'},
     73                        {"submitlength", required_argument, 0, 'l'},
    7274                        {0, 0, 0, 0}
    7375                };
    7476
    7577                int idx = 0;
    76                 int opt = getopt_long(argc, argv, "d:t:p:b:us", options, &idx);
     78                int opt = getopt_long(argc, argv, "d:t:p:b:usl:", options, &idx);
    7779
    7880                const char * arg = optarg ? optarg : "";
     
    116118                        case 's':
    117119                                flags |= CFA_CLUSTER_IO_POLLER_THREAD_SUBMITS;
     120                                break;
     121                        case 'l':
     122                                sublen = strtoul(arg, &end, 10);
     123                                if(*end != '\0' && sublen < 16) {
     124                                        fprintf(stderr, "Submit length must be at least 16, was %s\n", arg);
     125                                        goto usage;
     126                                }
     127                                flags |= (sublen << CFA_CLUSTER_IO_BUFFLEN_OFFSET);
    118128                                break;
    119129                        // Other cases
  • libcfa/src/concurrency/io.cfa

    r0335620 rdd4e2d7  
    2020
    2121#if !defined(HAVE_LINUX_IO_URING_H)
    22         void __kernel_io_startup( cluster &, int, bool ) {
     22        void __kernel_io_startup( cluster &, unsigned, bool ) {
    2323                // Nothing to do without io_uring
    2424        }
     
    205205// I/O Startup / Shutdown logic
    206206//=============================================================================================
    207         void __kernel_io_startup( cluster & this, int io_flags, bool main_cluster ) {
     207        void __kernel_io_startup( cluster & this, unsigned io_flags, bool main_cluster ) {
    208208                this.io = malloc();
    209209
     
    280280
    281281                if( io_flags & CFA_CLUSTER_IO_POLLER_THREAD_SUBMITS ) {
    282                         sq.ready_cnt = 32;
     282                        sq.ready_cnt = max(io_flags >> CFA_CLUSTER_IO_BUFFLEN_OFFSET, 8);
    283283                        sq.ready = alloc_align( 64, sq.ready_cnt );
    284284                        for(i; sq.ready_cnt) {
     
    753753                                __atomic_fetch_add( &ring.submit_q.stats.look_avg.cnt,   1,     __ATOMIC_RELAXED );
    754754                        #endif
     755
     756                        __cfadbg_print_safe( io, "Kernel I/O : Added %u to ready for %p\n", idx, active_thread() );
    755757                }
    756758                else {
     
    781783
    782784                        unlock(ring.submit_q.lock);
    783                 }
    784                 // Make sure that idx was submitted
    785                 // Be careful to not get false positive if we cycled the entire list or that someone else submitted for us
    786                 __cfadbg_print_safe( io, "Kernel I/O : Performed io_submit for %p, returned %d\n", active_thread(), ret );
     785
     786                        __cfadbg_print_safe( io, "Kernel I/O : Performed io_submit for %p, returned %d\n", active_thread(), ret );
     787                }
    787788        }
    788789
  • libcfa/src/concurrency/kernel.cfa

    r0335620 rdd4e2d7  
    256256}
    257257
    258 void ?{}(cluster & this, const char name[], Duration preemption_rate, int io_flags) with( this ) {
     258void ?{}(cluster & this, const char name[], Duration preemption_rate, unsigned io_flags) with( this ) {
    259259        this.name = name;
    260260        this.preemption_rate = preemption_rate;
  • libcfa/src/concurrency/kernel.hfa

    r0335620 rdd4e2d7  
    119119#define CFA_CLUSTER_IO_POLLER_THREAD_SUBMITS 1 << 1 // 0x2
    120120// #define CFA_CLUSTER_IO_POLLER_KERNEL_SIDE 1 << 2 // 0x4
     121#define CFA_CLUSTER_IO_BUFFLEN_OFFSET        16
    121122
    122123//-----------------------------------------------------------------------------
     
    160161extern Duration default_preemption();
    161162
    162 void ?{} (cluster & this, const char name[], Duration preemption_rate, int flags);
     163void ?{} (cluster & this, const char name[], Duration preemption_rate, unsigned flags);
    163164void ^?{}(cluster & this);
    164165
    165 static inline void ?{} (cluster & this)                                      { this{"Anonymous Cluster", default_preemption(), 0}; }
    166 static inline void ?{} (cluster & this, Duration preemption_rate)            { this{"Anonymous Cluster", preemption_rate, 0}; }
    167 static inline void ?{} (cluster & this, const char name[])                   { this{name, default_preemption(), 0}; }
    168 static inline void ?{} (cluster & this, int flags)                           { this{"Anonymous Cluster", default_preemption(), flags}; }
    169 static inline void ?{} (cluster & this, Duration preemption_rate, int flags) { this{"Anonymous Cluster", preemption_rate, flags}; }
    170 static inline void ?{} (cluster & this, const char name[], int flags)        { this{name, default_preemption(), flags}; }
     166static inline void ?{} (cluster & this)                                           { this{"Anonymous Cluster", default_preemption(), 0}; }
     167static inline void ?{} (cluster & this, Duration preemption_rate)                 { this{"Anonymous Cluster", preemption_rate, 0}; }
     168static inline void ?{} (cluster & this, const char name[])                        { this{name, default_preemption(), 0}; }
     169static inline void ?{} (cluster & this, unsigned flags)                           { this{"Anonymous Cluster", default_preemption(), flags}; }
     170static inline void ?{} (cluster & this, Duration preemption_rate, unsigned flags) { this{"Anonymous Cluster", preemption_rate, flags}; }
     171static inline void ?{} (cluster & this, const char name[], unsigned flags)        { this{name, default_preemption(), flags}; }
    171172
    172173static inline [cluster *&, cluster *& ] __get( cluster & this ) __attribute__((const)) { return this.node.[next, prev]; }
  • libcfa/src/concurrency/kernel_private.hfa

    r0335620 rdd4e2d7  
    7777//-----------------------------------------------------------------------------
    7878// I/O
    79 void __kernel_io_startup     ( cluster &, int, bool );
     79void __kernel_io_startup     ( cluster &, unsigned, bool );
    8080void __kernel_io_finish_start( cluster & );
    8181void __kernel_io_prepare_stop( cluster & );
Note: See TracChangeset for help on using the changeset viewer.