Ignore:
Timestamp:
May 8, 2020, 2:42:15 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
6c12fd28
Parents:
0335620
Message:

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

Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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.