Changeset dd4e2d7
- Timestamp:
- May 8, 2020, 2:42:15 PM (5 years ago)
- 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
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/readv.cfa
r0335620 rdd4e2d7 59 59 unsigned long int nthreads = 2; 60 60 unsigned long int nprocs = 1; 61 int flags = 0; 61 unsigned flags = 0; 62 unsigned sublen = 16; 62 63 63 64 arg_loop: … … 70 71 {"userthread", no_argument , 0, 'u'}, 71 72 {"submitthread", no_argument , 0, 's'}, 73 {"submitlength", required_argument, 0, 'l'}, 72 74 {0, 0, 0, 0} 73 75 }; 74 76 75 77 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); 77 79 78 80 const char * arg = optarg ? optarg : ""; … … 116 118 case 's': 117 119 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); 118 128 break; 119 129 // Other cases -
libcfa/src/concurrency/io.cfa
r0335620 rdd4e2d7 20 20 21 21 #if !defined(HAVE_LINUX_IO_URING_H) 22 void __kernel_io_startup( cluster &, int, bool ) {22 void __kernel_io_startup( cluster &, unsigned, bool ) { 23 23 // Nothing to do without io_uring 24 24 } … … 205 205 // I/O Startup / Shutdown logic 206 206 //============================================================================================= 207 void __kernel_io_startup( cluster & this, intio_flags, bool main_cluster ) {207 void __kernel_io_startup( cluster & this, unsigned io_flags, bool main_cluster ) { 208 208 this.io = malloc(); 209 209 … … 280 280 281 281 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); 283 283 sq.ready = alloc_align( 64, sq.ready_cnt ); 284 284 for(i; sq.ready_cnt) { … … 753 753 __atomic_fetch_add( &ring.submit_q.stats.look_avg.cnt, 1, __ATOMIC_RELAXED ); 754 754 #endif 755 756 __cfadbg_print_safe( io, "Kernel I/O : Added %u to ready for %p\n", idx, active_thread() ); 755 757 } 756 758 else { … … 781 783 782 784 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 } 787 788 } 788 789 -
libcfa/src/concurrency/kernel.cfa
r0335620 rdd4e2d7 256 256 } 257 257 258 void ?{}(cluster & this, const char name[], Duration preemption_rate, intio_flags) with( this ) {258 void ?{}(cluster & this, const char name[], Duration preemption_rate, unsigned io_flags) with( this ) { 259 259 this.name = name; 260 260 this.preemption_rate = preemption_rate; -
libcfa/src/concurrency/kernel.hfa
r0335620 rdd4e2d7 119 119 #define CFA_CLUSTER_IO_POLLER_THREAD_SUBMITS 1 << 1 // 0x2 120 120 // #define CFA_CLUSTER_IO_POLLER_KERNEL_SIDE 1 << 2 // 0x4 121 #define CFA_CLUSTER_IO_BUFFLEN_OFFSET 16 121 122 122 123 //----------------------------------------------------------------------------- … … 160 161 extern Duration default_preemption(); 161 162 162 void ?{} (cluster & this, const char name[], Duration preemption_rate, intflags);163 void ?{} (cluster & this, const char name[], Duration preemption_rate, unsigned flags); 163 164 void ^?{}(cluster & this); 164 165 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, intflags) { this{"Anonymous Cluster", default_preemption(), flags}; }169 static inline void ?{} (cluster & this, Duration preemption_rate, intflags) { this{"Anonymous Cluster", preemption_rate, flags}; }170 static inline void ?{} (cluster & this, const char name[], intflags) { this{name, default_preemption(), flags}; }166 static inline void ?{} (cluster & this) { this{"Anonymous Cluster", default_preemption(), 0}; } 167 static inline void ?{} (cluster & this, Duration preemption_rate) { this{"Anonymous Cluster", preemption_rate, 0}; } 168 static inline void ?{} (cluster & this, const char name[]) { this{name, default_preemption(), 0}; } 169 static inline void ?{} (cluster & this, unsigned flags) { this{"Anonymous Cluster", default_preemption(), flags}; } 170 static inline void ?{} (cluster & this, Duration preemption_rate, unsigned flags) { this{"Anonymous Cluster", preemption_rate, flags}; } 171 static inline void ?{} (cluster & this, const char name[], unsigned flags) { this{name, default_preemption(), flags}; } 171 172 172 173 static inline [cluster *&, cluster *& ] __get( cluster & this ) __attribute__((const)) { return this.node.[next, prev]; } -
libcfa/src/concurrency/kernel_private.hfa
r0335620 rdd4e2d7 77 77 //----------------------------------------------------------------------------- 78 78 // I/O 79 void __kernel_io_startup ( cluster &, int, bool );79 void __kernel_io_startup ( cluster &, unsigned, bool ); 80 80 void __kernel_io_finish_start( cluster & ); 81 81 void __kernel_io_prepare_stop( cluster & );
Note: See TracChangeset
for help on using the changeset viewer.