Changes in / [54eb5ebd:f19fbbc]
- Files:
-
- 14 edited
-
benchmark/io/http/filecache.cfa (modified) (1 diff)
-
benchmark/io/http/filecache.hfa (modified) (1 diff)
-
benchmark/io/http/main.cfa (modified) (2 diffs)
-
benchmark/io/http/worker.cfa (modified) (2 diffs)
-
libcfa/configure (modified) (23 diffs)
-
libcfa/configure.ac (modified) (1 diff)
-
libcfa/prelude/defines.hfa.in (modified) (1 diff)
-
libcfa/src/concurrency/io.cfa (modified) (4 diffs)
-
libcfa/src/concurrency/iocall.cfa (modified) (24 diffs)
-
libcfa/src/concurrency/kernel.cfa (modified) (8 diffs)
-
libcfa/src/concurrency/ready_queue.cfa (modified) (5 diffs)
-
libcfa/src/concurrency/snzi.hfa (modified) (1 diff)
-
libcfa/src/concurrency/stats.cfa (modified) (3 diffs)
-
libcfa/src/concurrency/stats.hfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/filecache.cfa
r54eb5ebd rf19fbbc 192 192 } 193 193 194 [int *, int] filefds(int extra) {195 if(!file_cache.entries) {196 abort("File cache not filled!\n");197 }198 199 return [aalloc(extra), 0];200 }201 202 203 194 void close_cache() { 204 195 for(idx; file_cache.size) { -
benchmark/io/http/filecache.hfa
r54eb5ebd rf19fbbc 11 11 [int fd, size_t size] get_file( * const char file, size_t len ); 12 12 void fill_cache( const char * path ); 13 [int *, int] filefds( int extra );14 13 void close_cache(); -
benchmark/io/http/main.cfa
r54eb5ebd rf19fbbc 93 93 &wait_connect = &chan; 94 94 95 int pipe_cnt = options.clopts.nworkers * 2;96 int pipe_off;97 int * fds;98 [fds, pipe_off] = filefds( pipe_cnt );99 for(i; 0 ~ pipe_cnt ~ 2) {100 int ret = pipe(&fds[pipe_off + i]);101 if( ret < 0 ) { abort( "pipe error: (%d) %s\n", (int)errno, strerror(errno) ); }102 }103 104 95 { 105 96 ServerProc procs[options.clopts.nprocs]; 106 97 { 107 98 Worker workers[options.clopts.nworkers]; 108 for(i; options.clopts.nworkers) {109 if( options.file_cache.fixed_fds ) {110 workers[i].pipe[0] = pipe_off + (i * 2) + 0;111 workers[i].pipe[1] = pipe_off + (i * 2) + 1;112 }113 else {114 workers[i].pipe[0] = fds[pipe_off + (i * 2) + 0];115 workers[i].pipe[1] = fds[pipe_off + (i * 2) + 1];116 }117 unpark( workers[i] __cfaabi_dbg_ctx2 );118 }119 99 printf("%d workers started on %d processors\n", options.clopts.nworkers, options.clopts.nprocs); 120 100 { … … 137 117 printf("Workers Closed\n"); 138 118 } 139 140 for(i; pipe_cnt) {141 ret = close( fds[pipe_off + i] );142 if(ret < 0) {143 abort( "close pipe error: (%d) %s\n", (int)errno, strerror(errno) );144 }145 }146 free(fds);147 119 } 148 120 -
benchmark/io/http/worker.cfa
r54eb5ebd rf19fbbc 12 12 #include "filecache.hfa" 13 13 14 extern "C" { 15 // extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); 16 extern ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags); 17 } 18 19 ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) { 20 return splice(in_fd, offset, out_fd, 0p, count, 0); 21 } 22 23 14 24 //============================================================================================= 15 25 // Worker Thread … … 17 27 void ?{}( Worker & this ) { 18 28 ((thread&)this){ "Server Worker Thread", *options.clopts.instance }; 19 this.pipe[0] = -1;20 this.pipe[1] = -1;29 int ret = pipe(this.pipe); 30 if( ret < 0 ) { abort( "pipe error: (%d) %s\n", (int)errno, strerror(errno) ); } 21 31 } 22 32 23 33 void main( Worker & this ) { 24 park( __cfaabi_dbg_ctx );25 /* paranoid */ assert( this.pipe[0] != -1 );26 /* paranoid */ assert( this.pipe[1] != -1 );27 28 34 CONNECTION: 29 35 for() { -
libcfa/configure
r54eb5ebd rf19fbbc 677 677 AMDEP_FALSE 678 678 AMDEP_TRUE 679 am__quote 679 680 am__include 680 681 DEPDIR … … 783 784 PACKAGE_NAME 784 785 PATH_SEPARATOR 785 SHELL 786 am__quote' 786 SHELL' 787 787 ac_subst_files='' 788 788 ac_user_opts=' … … 2054 2054 2055 2055 } # ac_fn_c_check_header_mongrel 2056 2057 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES2058 # ---------------------------------------------2059 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR2060 # accordingly.2061 ac_fn_c_check_decl ()2062 {2063 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack2064 as_decl_name=`echo $2|sed 's/ *(.*//'`2065 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`2066 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&52067 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }2068 if eval \${$3+:} false; then :2069 $as_echo_n "(cached) " >&62070 else2071 cat confdefs.h - <<_ACEOF >conftest.$ac_ext2072 /* end confdefs.h. */2073 $42074 int2075 main ()2076 {2077 #ifndef $as_decl_name2078 #ifdef __cplusplus2079 (void) $as_decl_use;2080 #else2081 (void) $as_decl_name;2082 #endif2083 #endif2084 2085 ;2086 return 0;2087 }2088 _ACEOF2089 if ac_fn_c_try_compile "$LINENO"; then :2090 eval "$3=yes"2091 else2092 eval "$3=no"2093 fi2094 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext2095 fi2096 eval ac_res=\$$32097 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&52098 $as_echo "$ac_res" >&6; }2099 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno2100 2101 } # ac_fn_c_check_decl2102 2056 cat >config.log <<_ACEOF 2103 2057 This file contains any messages produced by compilers while … … 2532 2486 2533 2487 2534 am__api_version='1.1 6'2488 am__api_version='1.15' 2535 2489 2536 2490 # Find a good install program. We prefer a C program (faster), … … 3009 2963 # For better backward compatibility. To be removed once Automake 1.9.x 3010 2964 # dies out for good. For more background, see: 3011 # <http s://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>3012 # <http s://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>2965 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 2966 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 3013 2967 mkdir_p='$(MKDIR_P)' 3014 2968 … … 3061 3015 3062 3016 You can download and install GNU coreutils to get an 'rm' implementation 3063 that behaves properly: <http s://www.gnu.org/software/coreutils/>.3017 that behaves properly: <http://www.gnu.org/software/coreutils/>. 3064 3018 3065 3019 If you want to complete the configuration process using your problematic … … 3445 3399 ac_config_commands="$ac_config_commands depfiles" 3446 3400 3447 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 3448 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6;}3449 cat > confinc .mk<< 'END'3401 3402 am_make=${MAKE-make} 3403 cat > confinc << 'END' 3450 3404 am__doit: 3451 @echo this is the am__doit target >confinc.out3405 @echo this is the am__doit target 3452 3406 .PHONY: am__doit 3453 3407 END 3408 # If we don't find an include directive, just comment out the code. 3409 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 3410 $as_echo_n "checking for style of include used by $am_make... " >&6; } 3454 3411 am__include="#" 3455 3412 am__quote= 3456 # BSD make does it like this. 3457 echo '.include "confinc.mk" # ignored' > confmf.BSD 3458 # Other make implementations (GNU, Solaris 10, AIX) do it like this. 3459 echo 'include confinc.mk # ignored' > confmf.GNU 3460 _am_result=no 3461 for s in GNU BSD; do 3462 { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 3463 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 3464 ac_status=$? 3465 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3466 (exit $ac_status); } 3467 case $?:`cat confinc.out 2>/dev/null` in #( 3468 '0:this is the am__doit target') : 3469 case $s in #( 3470 BSD) : 3471 am__include='.include' am__quote='"' ;; #( 3472 *) : 3473 am__include='include' am__quote='' ;; 3474 esac ;; #( 3475 *) : 3413 _am_result=none 3414 # First try GNU make style include. 3415 echo "include confinc" > confmf 3416 # Ignore all kinds of additional output from 'make'. 3417 case `$am_make -s -f confmf 2> /dev/null` in #( 3418 *the\ am__doit\ target*) 3419 am__include=include 3420 am__quote= 3421 _am_result=GNU 3422 ;; 3423 esac 3424 # Now try BSD make style include. 3425 if test "$am__include" = "#"; then 3426 echo '.include "confinc"' > confmf 3427 case `$am_make -s -f confmf 2> /dev/null` in #( 3428 *the\ am__doit\ target*) 3429 am__include=.include 3430 am__quote="\"" 3431 _am_result=BSD 3476 3432 ;; 3477 esac 3478 if test "$am__include" != "#"; then 3479 _am_result="yes ($s style)" 3480 break 3481 fi 3482 done 3483 rm -f confinc.* confmf.* 3484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 3485 $as_echo "${_am_result}" >&6; } 3433 esac 3434 fi 3435 3436 3437 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 3438 $as_echo "$_am_result" >&6; } 3439 rm -f confinc confmf 3486 3440 3487 3441 # Check whether --enable-dependency-tracking was given. … … 5987 5941 5988 5942 : ${AR=ar} 5989 : ${AR_FLAGS=cr }5943 : ${AR_FLAGS=cru} 5990 5944 5991 5945 … … 6488 6442 # Now try to grab the symbols. 6489 6443 nlist=conftest.nm 6490 $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 6491 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then 6444 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 6445 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 6446 ac_status=$? 6447 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 6448 test $ac_status = 0; } && test -s "$nlist"; then 6492 6449 # Try sorting and uniquifying the output. 6493 6450 if sort "$nlist" | uniq > "$nlist"T; then … … 7708 7665 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 7709 7666 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 7710 echo "$AR cr libconftest.a conftest.o" >&57711 $AR cr libconftest.a conftest.o 2>&57667 echo "$AR cru libconftest.a conftest.o" >&5 7668 $AR cru libconftest.a conftest.o 2>&5 7712 7669 echo "$RANLIB libconftest.a" >&5 7713 7670 $RANLIB libconftest.a 2>&5 … … 8835 8792 lt_prog_compiler_wl='-Wl,' 8836 8793 lt_prog_compiler_pic='-KPIC' 8837 lt_prog_compiler_static='-static'8838 ;;8839 # flang / f18. f95 an alias for gfortran or flang on Debian8840 flang* | f18* | f95*)8841 lt_prog_compiler_wl='-Wl,'8842 lt_prog_compiler_pic='-fPIC'8843 8794 lt_prog_compiler_static='-static' 8844 8795 ;; … … 13203 13154 # what "hidden" libraries, object files and flags are used when 13204 13155 # linking a shared library. 13205 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'13156 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 13206 13157 13207 13158 else … … 13695 13646 # from the output so that they don't get included in the library 13696 13647 # dependencies. 13697 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'13648 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' 13698 13649 ;; 13699 13650 *) … … 13760 13711 # from the output so that they don't get included in the library 13761 13712 # dependencies. 13762 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'13713 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' 13763 13714 ;; 13764 13715 *) … … 14099 14050 # what "hidden" libraries, object files and flags are used when 14100 14051 # linking a shared library. 14101 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'14052 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 14102 14053 14103 14054 else … … 14183 14134 # what "hidden" libraries, object files and flags are used when 14184 14135 # linking a shared library. 14185 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'14136 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 14186 14137 else 14187 14138 # g++ 2.7 appears to require '-G' NOT '-shared' on this … … 14194 14145 # what "hidden" libraries, object files and flags are used when 14195 14146 # linking a shared library. 14196 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'14147 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 14197 14148 fi 14198 14149 … … 17011 16962 17012 16963 17013 17014 17015 #io_uring 5.4 and earlier uses defines17016 #io_uring 5.5 uses enum values17017 #io_uring 5.6 and later uses probes17018 17019 16964 for ac_header in linux/io_uring.h 17020 16965 do : … … 17024 16969 #define HAVE_LINUX_IO_URING_H 1 17025 16970 _ACEOF 17026 17027 $as_echo "#define CFA_HAVE_LINUX_IO_URING_H 1" >>confdefs.h17028 17029 # AC_CHECK_HEADER([liburing.h], [17030 # AC_CHECK_LIB([uring], [io_uring_get_probe])17031 # ])17032 17033 ac_fn_c_check_decl "$LINENO" "IORING_OP_NOP" "ac_cv_have_decl_IORING_OP_NOP" "#include <linux/io_uring.h>17034 "17035 if test "x$ac_cv_have_decl_IORING_OP_NOP" = xyes; then :17036 $as_echo "#define CFA_HAVE_IORING_OP_NOP 1" >>confdefs.h17037 17038 fi17039 17040 17041 ac_fn_c_check_decl "$LINENO" "IORING_OP_READV" "ac_cv_have_decl_IORING_OP_READV" "#include <linux/io_uring.h>17042 "17043 if test "x$ac_cv_have_decl_IORING_OP_READV" = xyes; then :17044 $as_echo "#define CFA_HAVE_IORING_OP_READV 1" >>confdefs.h17045 17046 fi17047 17048 17049 ac_fn_c_check_decl "$LINENO" "IORING_OP_WRITEV" "ac_cv_have_decl_IORING_OP_WRITEV" "#include <linux/io_uring.h>17050 "17051 if test "x$ac_cv_have_decl_IORING_OP_WRITEV" = xyes; then :17052 $as_echo "#define CFA_HAVE_IORING_OP_WRITEV 1" >>confdefs.h17053 17054 fi17055 17056 17057 ac_fn_c_check_decl "$LINENO" "IORING_OP_FSYNC" "ac_cv_have_decl_IORING_OP_FSYNC" "#include <linux/io_uring.h>17058 "17059 if test "x$ac_cv_have_decl_IORING_OP_FSYNC" = xyes; then :17060 $as_echo "#define CFA_HAVE_IORING_OP_FSYNC 1" >>confdefs.h17061 17062 fi17063 17064 17065 ac_fn_c_check_decl "$LINENO" "IORING_OP_READ_FIXED" "ac_cv_have_decl_IORING_OP_READ_FIXED" "#include <linux/io_uring.h>17066 "17067 if test "x$ac_cv_have_decl_IORING_OP_READ_FIXED" = xyes; then :17068 $as_echo "#define CFA_HAVE_IORING_OP_READ_FIXED 1" >>confdefs.h17069 17070 fi17071 17072 17073 ac_fn_c_check_decl "$LINENO" "IORING_OP_WRITE_FIXED" "ac_cv_have_decl_IORING_OP_WRITE_FIXED" "#include <linux/io_uring.h>17074 "17075 if test "x$ac_cv_have_decl_IORING_OP_WRITE_FIXED" = xyes; then :17076 $as_echo "#define CFA_HAVE_IORING_OP_WRITE_FIXED 1" >>confdefs.h17077 17078 fi17079 17080 17081 ac_fn_c_check_decl "$LINENO" "IORING_OP_POLL_ADD" "ac_cv_have_decl_IORING_OP_POLL_ADD" "#include <linux/io_uring.h>17082 "17083 if test "x$ac_cv_have_decl_IORING_OP_POLL_ADD" = xyes; then :17084 $as_echo "#define CFA_HAVE_IORING_OP_POLL_ADD 1" >>confdefs.h17085 17086 fi17087 17088 17089 ac_fn_c_check_decl "$LINENO" "IORING_OP_POLL_REMOVE" "ac_cv_have_decl_IORING_OP_POLL_REMOVE" "#include <linux/io_uring.h>17090 "17091 if test "x$ac_cv_have_decl_IORING_OP_POLL_REMOVE" = xyes; then :17092 $as_echo "#define CFA_HAVE_IORING_OP_POLL_REMOVE 1" >>confdefs.h17093 17094 fi17095 17096 17097 ac_fn_c_check_decl "$LINENO" "IORING_OP_SYNC_FILE_RANGE" "ac_cv_have_decl_IORING_OP_SYNC_FILE_RANGE" "#include <linux/io_uring.h>17098 "17099 if test "x$ac_cv_have_decl_IORING_OP_SYNC_FILE_RANGE" = xyes; then :17100 $as_echo "#define CFA_HAVE_IORING_OP_SYNC_FILE_RANGE 1" >>confdefs.h17101 17102 fi17103 17104 17105 ac_fn_c_check_decl "$LINENO" "IORING_OP_SENDMSG" "ac_cv_have_decl_IORING_OP_SENDMSG" "#include <linux/io_uring.h>17106 "17107 if test "x$ac_cv_have_decl_IORING_OP_SENDMSG" = xyes; then :17108 $as_echo "#define CFA_HAVE_IORING_OP_SENDMSG 1" >>confdefs.h17109 17110 fi17111 17112 17113 ac_fn_c_check_decl "$LINENO" "IORING_OP_RECVMSG" "ac_cv_have_decl_IORING_OP_RECVMSG" "#include <linux/io_uring.h>17114 "17115 if test "x$ac_cv_have_decl_IORING_OP_RECVMSG" = xyes; then :17116 $as_echo "#define CFA_HAVE_IORING_OP_RECVMSG 1" >>confdefs.h17117 17118 fi17119 17120 17121 ac_fn_c_check_decl "$LINENO" "IORING_OP_TIMEOUT" "ac_cv_have_decl_IORING_OP_TIMEOUT" "#include <linux/io_uring.h>17122 "17123 if test "x$ac_cv_have_decl_IORING_OP_TIMEOUT" = xyes; then :17124 $as_echo "#define CFA_HAVE_IORING_OP_TIMEOUT 1" >>confdefs.h17125 17126 fi17127 17128 17129 ac_fn_c_check_decl "$LINENO" "IORING_OP_TIMEOUT_REMOVE" "ac_cv_have_decl_IORING_OP_TIMEOUT_REMOVE" "#include <linux/io_uring.h>17130 "17131 if test "x$ac_cv_have_decl_IORING_OP_TIMEOUT_REMOVE" = xyes; then :17132 $as_echo "#define CFA_HAVE_IORING_OP_TIMEOUT_REMOVE 1" >>confdefs.h17133 17134 fi17135 17136 17137 ac_fn_c_check_decl "$LINENO" "IORING_OP_ACCEPT" "ac_cv_have_decl_IORING_OP_ACCEPT" "#include <linux/io_uring.h>17138 "17139 if test "x$ac_cv_have_decl_IORING_OP_ACCEPT" = xyes; then :17140 $as_echo "#define CFA_HAVE_IORING_OP_ACCEPT 1" >>confdefs.h17141 17142 fi17143 17144 17145 ac_fn_c_check_decl "$LINENO" "IORING_OP_ASYNC_CANCEL" "ac_cv_have_decl_IORING_OP_ASYNC_CANCEL" "#include <linux/io_uring.h>17146 "17147 if test "x$ac_cv_have_decl_IORING_OP_ASYNC_CANCEL" = xyes; then :17148 $as_echo "#define CFA_HAVE_IORING_OP_ASYNC_CANCEL 1" >>confdefs.h17149 17150 fi17151 17152 17153 ac_fn_c_check_decl "$LINENO" "IORING_OP_LINK_TIMEOUT" "ac_cv_have_decl_IORING_OP_LINK_TIMEOUT" "#include <linux/io_uring.h>17154 "17155 if test "x$ac_cv_have_decl_IORING_OP_LINK_TIMEOUT" = xyes; then :17156 $as_echo "#define CFA_HAVE_IORING_OP_LINK_TIMEOUT 1" >>confdefs.h17157 17158 fi17159 17160 17161 ac_fn_c_check_decl "$LINENO" "IORING_OP_CONNECT" "ac_cv_have_decl_IORING_OP_CONNECT" "#include <linux/io_uring.h>17162 "17163 if test "x$ac_cv_have_decl_IORING_OP_CONNECT" = xyes; then :17164 $as_echo "#define CFA_HAVE_IORING_OP_CONNECT 1" >>confdefs.h17165 17166 fi17167 17168 17169 ac_fn_c_check_decl "$LINENO" "IORING_OP_FALLOCATE" "ac_cv_have_decl_IORING_OP_FALLOCATE" "#include <linux/io_uring.h>17170 "17171 if test "x$ac_cv_have_decl_IORING_OP_FALLOCATE" = xyes; then :17172 $as_echo "#define CFA_HAVE_IORING_OP_FALLOCATE 1" >>confdefs.h17173 17174 fi17175 17176 17177 ac_fn_c_check_decl "$LINENO" "IORING_OP_OPENAT" "ac_cv_have_decl_IORING_OP_OPENAT" "#include <linux/io_uring.h>17178 "17179 if test "x$ac_cv_have_decl_IORING_OP_OPENAT" = xyes; then :17180 $as_echo "#define CFA_HAVE_IORING_OP_OPENAT 1" >>confdefs.h17181 17182 fi17183 17184 17185 ac_fn_c_check_decl "$LINENO" "IORING_OP_CLOSE" "ac_cv_have_decl_IORING_OP_CLOSE" "#include <linux/io_uring.h>17186 "17187 if test "x$ac_cv_have_decl_IORING_OP_CLOSE" = xyes; then :17188 $as_echo "#define CFA_HAVE_IORING_OP_CLOSE 1" >>confdefs.h17189 17190 fi17191 17192 17193 ac_fn_c_check_decl "$LINENO" "IORING_OP_FILES_UPDATE" "ac_cv_have_decl_IORING_OP_FILES_UPDATE" "#include <linux/io_uring.h>17194 "17195 if test "x$ac_cv_have_decl_IORING_OP_FILES_UPDATE" = xyes; then :17196 $as_echo "#define CFA_HAVE_IORING_OP_FILES_UPDATE 1" >>confdefs.h17197 17198 fi17199 17200 17201 ac_fn_c_check_decl "$LINENO" "IORING_OP_STATX" "ac_cv_have_decl_IORING_OP_STATX" "#include <linux/io_uring.h>17202 "17203 if test "x$ac_cv_have_decl_IORING_OP_STATX" = xyes; then :17204 $as_echo "#define CFA_HAVE_IORING_OP_STATX 1" >>confdefs.h17205 17206 fi17207 17208 17209 ac_fn_c_check_decl "$LINENO" "IORING_OP_READ" "ac_cv_have_decl_IORING_OP_READ" "#include <linux/io_uring.h>17210 "17211 if test "x$ac_cv_have_decl_IORING_OP_READ" = xyes; then :17212 $as_echo "#define CFA_HAVE_IORING_OP_READ 1" >>confdefs.h17213 17214 fi17215 17216 17217 ac_fn_c_check_decl "$LINENO" "IORING_OP_WRITE" "ac_cv_have_decl_IORING_OP_WRITE" "#include <linux/io_uring.h>17218 "17219 if test "x$ac_cv_have_decl_IORING_OP_WRITE" = xyes; then :17220 $as_echo "#define CFA_HAVE_IORING_OP_WRITE 1" >>confdefs.h17221 17222 fi17223 17224 17225 ac_fn_c_check_decl "$LINENO" "IORING_OP_FADVISE" "ac_cv_have_decl_IORING_OP_FADVISE" "#include <linux/io_uring.h>17226 "17227 if test "x$ac_cv_have_decl_IORING_OP_FADVISE" = xyes; then :17228 $as_echo "#define CFA_HAVE_IORING_OP_FADVISE 1" >>confdefs.h17229 17230 fi17231 17232 17233 ac_fn_c_check_decl "$LINENO" "IORING_OP_MADVISE" "ac_cv_have_decl_IORING_OP_MADVISE" "#include <linux/io_uring.h>17234 "17235 if test "x$ac_cv_have_decl_IORING_OP_MADVISE" = xyes; then :17236 $as_echo "#define CFA_HAVE_IORING_OP_MADVISE 1" >>confdefs.h17237 17238 fi17239 17240 17241 ac_fn_c_check_decl "$LINENO" "IORING_OP_SEND" "ac_cv_have_decl_IORING_OP_SEND" "#include <linux/io_uring.h>17242 "17243 if test "x$ac_cv_have_decl_IORING_OP_SEND" = xyes; then :17244 $as_echo "#define CFA_HAVE_IORING_OP_SEND 1" >>confdefs.h17245 17246 fi17247 17248 17249 ac_fn_c_check_decl "$LINENO" "IORING_OP_RECV" "ac_cv_have_decl_IORING_OP_RECV" "#include <linux/io_uring.h>17250 "17251 if test "x$ac_cv_have_decl_IORING_OP_RECV" = xyes; then :17252 $as_echo "#define CFA_HAVE_IORING_OP_RECV 1" >>confdefs.h17253 17254 fi17255 17256 17257 ac_fn_c_check_decl "$LINENO" "IORING_OP_OPENAT2" "ac_cv_have_decl_IORING_OP_OPENAT2" "#include <linux/io_uring.h>17258 "17259 if test "x$ac_cv_have_decl_IORING_OP_OPENAT2" = xyes; then :17260 $as_echo "#define CFA_HAVE_IORING_OP_OPENAT2 1" >>confdefs.h17261 17262 fi17263 17264 17265 ac_fn_c_check_decl "$LINENO" "IORING_OP_EPOLL_CTL" "ac_cv_have_decl_IORING_OP_EPOLL_CTL" "#include <linux/io_uring.h>17266 "17267 if test "x$ac_cv_have_decl_IORING_OP_EPOLL_CTL" = xyes; then :17268 $as_echo "#define CFA_HAVE_IORING_OP_EPOLL_CTL 1" >>confdefs.h17269 17270 fi17271 17272 17273 ac_fn_c_check_decl "$LINENO" "IORING_OP_SPLICE" "ac_cv_have_decl_IORING_OP_SPLICE" "#include <linux/io_uring.h>17274 "17275 if test "x$ac_cv_have_decl_IORING_OP_SPLICE" = xyes; then :17276 $as_echo "#define CFA_HAVE_IORING_OP_SPLICE 1" >>confdefs.h17277 17278 fi17279 17280 17281 ac_fn_c_check_decl "$LINENO" "IORING_OP_PROVIDE_BUFFERS" "ac_cv_have_decl_IORING_OP_PROVIDE_BUFFERS" "#include <linux/io_uring.h>17282 "17283 if test "x$ac_cv_have_decl_IORING_OP_PROVIDE_BUFFERS" = xyes; then :17284 $as_echo "#define CFA_HAVE_IORING_OP_PROVIDE_BUFFERS 1" >>confdefs.h17285 17286 fi17287 17288 17289 ac_fn_c_check_decl "$LINENO" "IORING_OP_REMOVE_BUFFER" "ac_cv_have_decl_IORING_OP_REMOVE_BUFFER" "#include <linux/io_uring.h>17290 "17291 if test "x$ac_cv_have_decl_IORING_OP_REMOVE_BUFFER" = xyes; then :17292 $as_echo "#define CFA_HAVE_IORING_OP_REMOVE_BUFFER 1" >>confdefs.h17293 17294 fi17295 17296 17297 16971 17298 16972 fi … … 18054 17728 # INIT-COMMANDS 18055 17729 # 18056 AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"17730 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" 18057 17731 18058 17732 … … 19050 18724 # are listed without --file. Let's play safe and only enable the eval 19051 18725 # if we detect the quoting. 19052 # TODO: see whether this extra hack can be removed once we start 19053 # requiring Autoconf 2.70 or later. 19054 case $CONFIG_FILES in #( 19055 *\'*) : 19056 eval set x "$CONFIG_FILES" ;; #( 19057 *) : 19058 set x $CONFIG_FILES ;; #( 19059 *) : 19060 ;; 19061 esac 18726 case $CONFIG_FILES in 18727 *\'*) eval set x "$CONFIG_FILES" ;; 18728 *) set x $CONFIG_FILES ;; 18729 esac 19062 18730 shift 19063 # Used to flag and report bootstrapping failures. 19064 am_rc=0 19065 for am_mf 18731 for mf 19066 18732 do 19067 18733 # Strip MF so we end up with the name of the file. 19068 am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` 19069 # Check whether this is an Automake generated Makefile which includes 19070 # dependency-tracking related rules and includes. 19071 # Grep'ing the whole file directly is not great: AIX grep has a line 18734 mf=`echo "$mf" | sed -e 's/:.*$//'` 18735 # Check whether this is an Automake generated Makefile or not. 18736 # We used to match only the files named 'Makefile.in', but 18737 # some people rename them; so instead we look at the file content. 18738 # Grep'ing the first line is not enough: some people post-process 18739 # each Makefile.in and add a new line on top of each file to say so. 18740 # Grep'ing the whole file is not good either: AIX grep has a line 19072 18741 # limit of 2048, but all sed's we know have understand at least 4000. 19073 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ 19074 || continue 19075 am_dirpart=`$as_dirname -- "$am_mf" || 19076 $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 19077 X"$am_mf" : 'X\(//\)[^/]' \| \ 19078 X"$am_mf" : 'X\(//\)$' \| \ 19079 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || 19080 $as_echo X"$am_mf" | 18742 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 18743 dirpart=`$as_dirname -- "$mf" || 18744 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 18745 X"$mf" : 'X\(//\)[^/]' \| \ 18746 X"$mf" : 'X\(//\)$' \| \ 18747 X"$mf" : 'X\(/\)' \| . 2>/dev/null || 18748 $as_echo X"$mf" | 19081 18749 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 19082 18750 s//\1/ … … 19096 18764 } 19097 18765 s/.*/./; q'` 19098 am_filepart=`$as_basename -- "$am_mf" || 19099 $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ 19100 X"$am_mf" : 'X\(//\)$' \| \ 19101 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || 19102 $as_echo X/"$am_mf" | 19103 sed '/^.*\/\([^/][^/]*\)\/*$/{ 18766 else 18767 continue 18768 fi 18769 # Extract the definition of DEPDIR, am__include, and am__quote 18770 # from the Makefile without running 'make'. 18771 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 18772 test -z "$DEPDIR" && continue 18773 am__include=`sed -n 's/^am__include = //p' < "$mf"` 18774 test -z "$am__include" && continue 18775 am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 18776 # Find all dependency output files, they are included files with 18777 # $(DEPDIR) in their names. We invoke sed twice because it is the 18778 # simplest approach to changing $(DEPDIR) to its actual value in the 18779 # expansion. 18780 for file in `sed -n " 18781 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 18782 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do 18783 # Make sure the directory exists. 18784 test -f "$dirpart/$file" && continue 18785 fdir=`$as_dirname -- "$file" || 18786 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 18787 X"$file" : 'X\(//\)[^/]' \| \ 18788 X"$file" : 'X\(//\)$' \| \ 18789 X"$file" : 'X\(/\)' \| . 2>/dev/null || 18790 $as_echo X"$file" | 18791 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 19104 18792 s//\1/ 19105 18793 q 19106 18794 } 19107 /^X\ /\(\/\/\)$/{18795 /^X\(\/\/\)[^/].*/{ 19108 18796 s//\1/ 19109 18797 q 19110 18798 } 19111 /^X\/\(\/\).*/{ 18799 /^X\(\/\/\)$/{ 18800 s//\1/ 18801 q 18802 } 18803 /^X\(\/\).*/{ 19112 18804 s//\1/ 19113 18805 q 19114 18806 } 19115 18807 s/.*/./; q'` 19116 { echo "$as_me:$LINENO: cd "$am_dirpart" \ 19117 && sed -e '/# am--include-marker/d' "$am_filepart" \ 19118 | $MAKE -f - am--depfiles" >&5 19119 (cd "$am_dirpart" \ 19120 && sed -e '/# am--include-marker/d' "$am_filepart" \ 19121 | $MAKE -f - am--depfiles) >&5 2>&5 19122 ac_status=$? 19123 echo "$as_me:$LINENO: \$? = $ac_status" >&5 19124 (exit $ac_status); } || am_rc=$? 18808 as_dir=$dirpart/$fdir; as_fn_mkdir_p 18809 # echo "creating $dirpart/$file" 18810 echo '# dummy' > "$dirpart/$file" 18811 done 19125 18812 done 19126 if test $am_rc -ne 0; then19127 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&519128 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}19129 as_fn_error $? "Something went wrong bootstrapping makefile fragments19130 for automatic dependency tracking. Try re-running configure with the19131 '--disable-dependency-tracking' option to at least be able to build19132 the package (albeit without support for automatic dependency tracking).19133 See \`config.log' for more details" "$LINENO" 5; }19134 fi19135 { am_dirpart=; unset am_dirpart;}19136 { am_filepart=; unset am_filepart;}19137 { am_mf=; unset am_mf;}19138 { am_rc=; unset am_rc;}19139 rm -f conftest-deps.mk19140 18813 } 19141 18814 ;; … … 19155 18828 #! $SHELL 19156 18829 # Generated automatically by $as_me ($PACKAGE) $VERSION 18830 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: 19157 18831 # NOTE: Changes made to this file will be lost: look at ltmain.sh. 19158 18832 -
libcfa/configure.ac
r54eb5ebd rf19fbbc 123 123 AC_PROG_MAKE_SET 124 124 125 126 127 #io_uring 5.4 and earlier uses defines 128 #io_uring 5.5 uses enum values 129 #io_uring 5.6 and later uses probes 130 131 AC_CHECK_HEADERS([linux/io_uring.h], [ 132 AC_DEFINE(CFA_HAVE_LINUX_IO_URING_H) 133 # AC_CHECK_HEADER([liburing.h], [ 134 # AC_CHECK_LIB([uring], [io_uring_get_probe]) 135 # ]) 136 m4_foreach([op], [IORING_OP_NOP,IORING_OP_READV,IORING_OP_WRITEV,IORING_OP_FSYNC,IORING_OP_READ_FIXED,IORING_OP_WRITE_FIXED,IORING_OP_POLL_ADD,IORING_OP_POLL_REMOVE,IORING_OP_SYNC_FILE_RANGE,IORING_OP_SENDMSG,IORING_OP_RECVMSG,IORING_OP_TIMEOUT,IORING_OP_TIMEOUT_REMOVE,IORING_OP_ACCEPT,IORING_OP_ASYNC_CANCEL,IORING_OP_LINK_TIMEOUT,IORING_OP_CONNECT,IORING_OP_FALLOCATE,IORING_OP_OPENAT,IORING_OP_CLOSE,IORING_OP_FILES_UPDATE,IORING_OP_STATX,IORING_OP_READ,IORING_OP_WRITE,IORING_OP_FADVISE,IORING_OP_MADVISE,IORING_OP_SEND,IORING_OP_RECV,IORING_OP_OPENAT2,IORING_OP_EPOLL_CTL,IORING_OP_SPLICE,IORING_OP_PROVIDE_BUFFERS,IORING_OP_REMOVE_BUFFER], [ 137 AC_CHECK_DECL(op, [AC_DEFINE([CFA_HAVE_]op)], [], [[#include <linux/io_uring.h>]]) 138 ]) 139 ]) 125 AC_CHECK_HEADERS([linux/io_uring.h]) 140 126 AC_CHECK_FUNCS([preadv2 pwritev2]) 141 127 -
libcfa/prelude/defines.hfa.in
r54eb5ebd rf19fbbc 14 14 // 15 15 16 #undef CFA_HAVE_LINUX_IO_URING_H 17 18 #undef CFA_HAVE_IORING_OP_NOP 19 #undef CFA_HAVE_IORING_OP_READV 20 #undef CFA_HAVE_IORING_OP_WRITEV 21 #undef CFA_HAVE_IORING_OP_FSYNC 22 #undef CFA_HAVE_IORING_OP_READ_FIXED 23 #undef CFA_HAVE_IORING_OP_WRITE_FIXED 24 #undef CFA_HAVE_IORING_OP_POLL_ADD 25 #undef CFA_HAVE_IORING_OP_POLL_REMOVE 26 #undef CFA_HAVE_IORING_OP_SYNC_FILE_RANGE 27 #undef CFA_HAVE_IORING_OP_SENDMSG 28 #undef CFA_HAVE_IORING_OP_RECVMSG 29 #undef CFA_HAVE_IORING_OP_TIMEOUT 30 #undef CFA_HAVE_IORING_OP_TIMEOUT_REMOVE 31 #undef CFA_HAVE_IORING_OP_ACCEPT 32 #undef CFA_HAVE_IORING_OP_ASYNC_CANCEL 33 #undef CFA_HAVE_IORING_OP_LINK_TIMEOUT 34 #undef CFA_HAVE_IORING_OP_CONNECT 35 #undef CFA_HAVE_IORING_OP_FALLOCATE 36 #undef CFA_HAVE_IORING_OP_OPENAT 37 #undef CFA_HAVE_IORING_OP_CLOSE 38 #undef CFA_HAVE_IORING_OP_FILES_UPDATE 39 #undef CFA_HAVE_IORING_OP_STATX 40 #undef CFA_HAVE_IORING_OP_READ 41 #undef CFA_HAVE_IORING_OP_WRITE 42 #undef CFA_HAVE_IORING_OP_FADVISE 43 #undef CFA_HAVE_IORING_OP_MADVISE 44 #undef CFA_HAVE_IORING_OP_SEND 45 #undef CFA_HAVE_IORING_OP_RECV 46 #undef CFA_HAVE_IORING_OP_OPENAT2 47 #undef CFA_HAVE_IORING_OP_EPOLL_CTL 48 #undef CFA_HAVE_IORING_OP_SPLICE 49 #undef CFA_HAVE_IORING_OP_PROVIDE_BUFFERS 50 #undef CFA_HAVE_IORING_OP_REMOVE_BUFFER 16 #undef HAVE_LINUX_IO_URING_H 51 17 52 18 #undef HAVE_PREADV2 -
libcfa/src/concurrency/io.cfa
r54eb5ebd rf19fbbc 16 16 #if defined(__CFA_DEBUG__) 17 17 // #define __CFA_DEBUG_PRINT_IO__ 18 //#define __CFA_DEBUG_PRINT_IO_CORE__18 #define __CFA_DEBUG_PRINT_IO_CORE__ 19 19 #endif 20 20 … … 22 22 #include "bitmanip.hfa" 23 23 24 #if !defined( CFA_HAVE_LINUX_IO_URING_H)24 #if !defined(HAVE_LINUX_IO_URING_H) 25 25 void __kernel_io_startup( cluster &, unsigned, bool ) { 26 26 // Nothing to do without io_uring … … 490 490 static uint32_t __release_consumed_submission( struct __io_data & ring ); 491 491 492 static inline void process(struct io_uring_cqe & cqe, struct __processor_id_t * id ) {493 struct __io_user_data_t * data = (struct __io_user_data_t *)(uintptr_t)cqe.user_data;494 __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", data, cqe.res, data->thrd );495 496 data->result = cqe.res;497 if(!id) { unpark( data->thrd __cfaabi_dbg_ctx2 ); }498 else { __unpark( id, data->thrd __cfaabi_dbg_ctx2 ); }499 }500 501 492 // Process a single completion message from the io_uring 502 493 // This is NOT thread-safe … … 547 538 /* paranoid */ verify(&cqe); 548 539 549 process( cqe, !mask ? (struct __processor_id_t *)0p : &ring.poller.slow.id ); 540 struct __io_user_data_t * data = (struct __io_user_data_t *)(uintptr_t)cqe.user_data; 541 __cfadbg_print_safe( io, "Kernel I/O : Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd ); 542 543 data->result = cqe.res; 544 if(!mask) { unpark( data->thrd __cfaabi_dbg_ctx2 ); } 545 else { __unpark( &ring.poller.slow.id, data->thrd __cfaabi_dbg_ctx2 ); } 550 546 } 551 547 -
libcfa/src/concurrency/iocall.cfa
r54eb5ebd rf19fbbc 20 20 //============================================================================================= 21 21 22 #if defined( CFA_HAVE_LINUX_IO_URING_H)22 #if defined(HAVE_LINUX_IO_URING_H) 23 23 #include <stdint.h> 24 24 #include <linux/io_uring.h> … … 122 122 #if defined(HAVE_PREADV2) 123 123 ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) { 124 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_READV)124 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READV) 125 125 return preadv2(fd, iov, iovcnt, offset, flags); 126 126 #else … … 134 134 135 135 ssize_t cfa_preadv2_fixed(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) { 136 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_READV)136 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READV) 137 137 return preadv2(fd, iov, iovcnt, offset, flags); 138 138 #else … … 149 149 #if defined(HAVE_PWRITEV2) 150 150 ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) { 151 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_WRITEV)151 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_WRITEV) 152 152 return pwritev2(fd, iov, iovcnt, offset, flags); 153 153 #else … … 162 162 163 163 int cfa_fsync(int fd) { 164 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FSYNC)164 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_FSYNC) 165 165 return fsync(fd); 166 166 #else … … 174 174 175 175 int cfa_sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags) { 176 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SYNC_FILE_RANGE)176 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SYNC_FILE_RANGE) 177 177 return sync_file_range(fd, offset, nbytes, flags); 178 178 #else … … 190 190 191 191 ssize_t cfa_sendmsg(int sockfd, const struct msghdr *msg, int flags) { 192 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SENDMSG)192 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SENDMSG) 193 193 return sendmsg(sockfd, msg, flags); 194 194 #else … … 203 203 204 204 ssize_t cfa_recvmsg(int sockfd, struct msghdr *msg, int flags) { 205 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_RECVMSG)205 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_RECVMSG) 206 206 return recvmsg(sockfd, msg, flags); 207 207 #else … … 216 216 217 217 ssize_t cfa_send(int sockfd, const void *buf, size_t len, int flags) { 218 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SEND)218 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SEND) 219 219 return send( sockfd, buf, len, flags ); 220 220 #else … … 231 231 232 232 ssize_t cfa_recv(int sockfd, void *buf, size_t len, int flags) { 233 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_RECV)233 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_RECV) 234 234 return recv( sockfd, buf, len, flags ); 235 235 #else … … 246 246 247 247 int cfa_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) { 248 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_ACCEPT)248 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_ACCEPT) 249 249 return accept4( sockfd, addr, addrlen, flags ); 250 250 #else … … 261 261 262 262 int cfa_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { 263 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_CONNECT)263 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_CONNECT) 264 264 return connect( sockfd, addr, addrlen ); 265 265 #else … … 275 275 276 276 int cfa_fallocate(int fd, int mode, uint64_t offset, uint64_t len) { 277 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FALLOCATE)277 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_FALLOCATE) 278 278 return fallocate( fd, mode, offset, len ); 279 279 #else … … 290 290 291 291 int cfa_fadvise(int fd, uint64_t offset, uint64_t len, int advice) { 292 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FADVISE)292 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_FADVISE) 293 293 return posix_fadvise( fd, offset, len, advice ); 294 294 #else … … 305 305 306 306 int cfa_madvise(void *addr, size_t length, int advice) { 307 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_MADVISE)307 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_MADVISE) 308 308 return madvise( addr, length, advice ); 309 309 #else … … 320 320 321 321 int cfa_openat(int dirfd, const char *pathname, int flags, mode_t mode) { 322 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_OPENAT)322 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_OPENAT) 323 323 return openat( dirfd, pathname, flags, mode ); 324 324 #else … … 335 335 336 336 int cfa_close(int fd) { 337 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_CLOSE)337 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_CLOSE) 338 338 return close( fd ); 339 339 #else … … 349 349 struct statx; 350 350 int cfa_statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf) { 351 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_STATX)351 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_STATX) 352 352 #if defined(__NR_statx) 353 353 return syscall( __NR_statx, dirfd, pathname, flags, mask, statxbuf ); … … 367 367 368 368 ssize_t cfa_read(int fd, void *buf, size_t count) { 369 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_READ)369 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READ) 370 370 return read( fd, buf, count ); 371 371 #else … … 379 379 380 380 ssize_t cfa_write(int fd, void *buf, size_t count) { 381 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_WRITE)381 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_WRITE) 382 382 return read( fd, buf, count ); 383 383 #else … … 391 391 392 392 ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags) { 393 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SPLICE)393 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SPLICE) 394 394 return splice( fd_in, off_in, fd_out, off_out, len, flags ); 395 395 #else … … 405 405 } 406 406 407 ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags, int in_flags, int out_flags) {408 #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SPLICE)409 return splice( fd_in, off_in, fd_out, off_out, len, flags );410 #else411 __submit_prelude412 413 (*sqe){ IORING_OP_SPLICE, fd_out, 0p, len, off_out };414 sqe->splice_fd_in = fd_in;415 sqe->splice_off_in = off_in;416 sqe->splice_flags = flags | out_flags;417 sqe->flags = in_flags;418 419 __submit_wait420 #endif421 }422 423 407 ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags) { 424 #if !defined( CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_TEE)408 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_TEE) 425 409 return tee( fd_in, fd_out, len, flags ); 426 410 #else … … 445 429 446 430 bool has_user_level_blocking( fptr_t func ) { 447 #if defined( CFA_HAVE_LINUX_IO_URING_H)431 #if defined(HAVE_LINUX_IO_URING_H) 448 432 #if defined(HAVE_PREADV2) 449 433 if( /*func == (fptr_t)preadv2 || */ 450 434 func == (fptr_t)cfa_preadv2 ) 451 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_READV ,452 return IS_DEFINED( CFA_HAVE_IORING_OP_READV);435 #define _CFA_IO_FEATURE_IORING_OP_READV , 436 return IS_DEFINED(IORING_OP_READV); 453 437 #endif 454 438 … … 456 440 if( /*func == (fptr_t)pwritev2 || */ 457 441 func == (fptr_t)cfa_pwritev2 ) 458 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_WRITEV ,459 return IS_DEFINED( CFA_HAVE_IORING_OP_WRITEV);442 #define _CFA_IO_FEATURE_IORING_OP_WRITEV , 443 return IS_DEFINED(IORING_OP_WRITEV); 460 444 #endif 461 445 462 446 if( /*func == (fptr_t)fsync || */ 463 447 func == (fptr_t)cfa_fsync ) 464 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_FSYNC ,465 return IS_DEFINED( CFA_HAVE_IORING_OP_FSYNC);448 #define _CFA_IO_FEATURE_IORING_OP_FSYNC , 449 return IS_DEFINED(IORING_OP_FSYNC); 466 450 467 451 if( /*func == (fptr_t)ync_file_range || */ 468 452 func == (fptr_t)cfa_sync_file_range ) 469 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_SYNC_FILE_RANGE ,470 return IS_DEFINED( CFA_HAVE_IORING_OP_SYNC_FILE_RANGE);453 #define _CFA_IO_FEATURE_IORING_OP_SYNC_FILE_RANGE , 454 return IS_DEFINED(IORING_OP_SYNC_FILE_RANGE); 471 455 472 456 if( /*func == (fptr_t)sendmsg || */ 473 457 func == (fptr_t)cfa_sendmsg ) 474 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_SENDMSG ,475 return IS_DEFINED( CFA_HAVE_IORING_OP_SENDMSG);458 #define _CFA_IO_FEATURE_IORING_OP_SENDMSG , 459 return IS_DEFINED(IORING_OP_SENDMSG); 476 460 477 461 if( /*func == (fptr_t)recvmsg || */ 478 462 func == (fptr_t)cfa_recvmsg ) 479 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_RECVMSG ,480 return IS_DEFINED( CFA_HAVE_IORING_OP_RECVMSG);463 #define _CFA_IO_FEATURE_IORING_OP_RECVMSG , 464 return IS_DEFINED(IORING_OP_RECVMSG); 481 465 482 466 if( /*func == (fptr_t)send || */ 483 467 func == (fptr_t)cfa_send ) 484 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_SEND ,485 return IS_DEFINED( CFA_HAVE_IORING_OP_SEND);468 #define _CFA_IO_FEATURE_IORING_OP_SEND , 469 return IS_DEFINED(IORING_OP_SEND); 486 470 487 471 if( /*func == (fptr_t)recv || */ 488 472 func == (fptr_t)cfa_recv ) 489 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_RECV ,490 return IS_DEFINED( CFA_HAVE_IORING_OP_RECV);473 #define _CFA_IO_FEATURE_IORING_OP_RECV , 474 return IS_DEFINED(IORING_OP_RECV); 491 475 492 476 if( /*func == (fptr_t)accept4 || */ 493 477 func == (fptr_t)cfa_accept4 ) 494 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_ACCEPT ,495 return IS_DEFINED( CFA_HAVE_IORING_OP_ACCEPT);478 #define _CFA_IO_FEATURE_IORING_OP_ACCEPT , 479 return IS_DEFINED(IORING_OP_ACCEPT); 496 480 497 481 if( /*func == (fptr_t)connect || */ 498 482 func == (fptr_t)cfa_connect ) 499 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_CONNECT ,500 return IS_DEFINED( CFA_HAVE_IORING_OP_CONNECT);483 #define _CFA_IO_FEATURE_IORING_OP_CONNECT , 484 return IS_DEFINED(IORING_OP_CONNECT); 501 485 502 486 if( /*func == (fptr_t)fallocate || */ 503 487 func == (fptr_t)cfa_fallocate ) 504 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_FALLOCATE ,505 return IS_DEFINED( CFA_HAVE_IORING_OP_FALLOCATE);488 #define _CFA_IO_FEATURE_IORING_OP_FALLOCATE , 489 return IS_DEFINED(IORING_OP_FALLOCATE); 506 490 507 491 if( /*func == (fptr_t)posix_fadvise || */ 508 492 func == (fptr_t)cfa_fadvise ) 509 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_FADVISE ,510 return IS_DEFINED( CFA_HAVE_IORING_OP_FADVISE);493 #define _CFA_IO_FEATURE_IORING_OP_FADVISE , 494 return IS_DEFINED(IORING_OP_FADVISE); 511 495 512 496 if( /*func == (fptr_t)madvise || */ 513 497 func == (fptr_t)cfa_madvise ) 514 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_MADVISE ,515 return IS_DEFINED( CFA_HAVE_IORING_OP_MADVISE);498 #define _CFA_IO_FEATURE_IORING_OP_MADVISE , 499 return IS_DEFINED(IORING_OP_MADVISE); 516 500 517 501 if( /*func == (fptr_t)openat || */ 518 502 func == (fptr_t)cfa_openat ) 519 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_OPENAT ,520 return IS_DEFINED( CFA_HAVE_IORING_OP_OPENAT);503 #define _CFA_IO_FEATURE_IORING_OP_OPENAT , 504 return IS_DEFINED(IORING_OP_OPENAT); 521 505 522 506 if( /*func == (fptr_t)close || */ 523 507 func == (fptr_t)cfa_close ) 524 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_CLOSE ,525 return IS_DEFINED( CFA_HAVE_IORING_OP_CLOSE);508 #define _CFA_IO_FEATURE_IORING_OP_CLOSE , 509 return IS_DEFINED(IORING_OP_CLOSE); 526 510 527 511 if( /*func == (fptr_t)read || */ 528 512 func == (fptr_t)cfa_read ) 529 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_READ ,530 return IS_DEFINED( CFA_HAVE_IORING_OP_READ);513 #define _CFA_IO_FEATURE_IORING_OP_READ , 514 return IS_DEFINED(IORING_OP_READ); 531 515 532 516 if( /*func == (fptr_t)write || */ 533 517 func == (fptr_t)cfa_write ) 534 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_WRITE ,535 return IS_DEFINED( CFA_HAVE_IORING_OP_WRITE);518 #define _CFA_IO_FEATURE_IORING_OP_WRITE , 519 return IS_DEFINED(IORING_OP_WRITE); 536 520 537 521 if( /*func == (fptr_t)splice || */ 538 func == (fptr_t)(ssize_t (*)(int, loff_t *, int, loff_t *, size_t, unsigned int))cfa_splice, 539 func == (fptr_t)(ssize_t (*)(int, loff_t *, int, loff_t *, size_t, unsigned int, int, int))cfa_splice ) 540 #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_SPLICE , 541 return IS_DEFINED(CFA_HAVE_IORING_OP_SPLICE); 522 func == (fptr_t)cfa_splice ) 523 #define _CFA_IO_FEATURE_IORING_OP_SPLICE , 524 return IS_DEFINED(IORING_OP_SPLICE); 542 525 543 526 if( /*func == (fptr_t)tee || */ 544 527 func == (fptr_t)cfa_tee ) 545 #define _CFA_IO_FEATURE_ CFA_HAVE_IORING_OP_TEE ,546 return IS_DEFINED( CFA_HAVE_IORING_OP_TEE);528 #define _CFA_IO_FEATURE_IORING_OP_TEE , 529 return IS_DEFINED(IORING_OP_TEE); 547 530 #endif 548 531 -
libcfa/src/concurrency/kernel.cfa
r54eb5ebd rf19fbbc 228 228 static void * __invoke_processor(void * arg); 229 229 230 static init(processor & this, const char name[], cluster & _cltr) with( this ) {230 void ?{}(processor & this, const char name[], cluster & _cltr) with( this ) { 231 231 this.name = name; 232 232 this.cltr = &_cltr; 233 233 id = -1u; 234 terminated{ 0 }; 234 235 destroyer = 0p; 235 236 do_terminate = false; 236 237 preemption_alarm = 0p; 237 238 pending_preemption = false; 239 runner.proc = &this; 238 240 239 241 #if !defined(__CFA_NO_STATISTICS__) … … 242 244 #endif 243 245 246 idle{}; 247 248 __cfadbg_print_safe(runtime_core, "Kernel : Starting core %p\n", &this); 249 250 this.stack = __create_pthread( &this.kernel_thread, __invoke_processor, (void *)&this ); 244 251 __atomic_fetch_add( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); 245 252 246 id = doregister((__processor_id_t*)&this);247 248 // Lock the RWlock so no-one pushes/pops while we are changing the queue249 uint_fast32_t last_size = ready_mutate_lock();250 251 // Adjust the ready queue size252 ready_queue_grow( cltr );253 254 // Unlock the RWlock255 ready_mutate_unlock( last_size );256 257 253 __cfadbg_print_safe(runtime_core, "Kernel : core %p created\n", &this); 258 }259 260 // Not a ctor, it just preps the destruction but should not destroy members261 void deinit(processor & this) {262 // Lock the RWlock so no-one pushes/pops while we are changing the queue263 uint_fast32_t last_size = ready_mutate_lock();264 265 // Adjust the ready queue size266 ready_queue_shrink( this.cltr );267 268 // Make sure we aren't on the idle queue269 unsafe_remove( this.cltr->idles, &this );270 271 // Unlock the RWlock272 ready_mutate_unlock( last_size );273 274 // Finally we don't need the read_lock any more275 unregister((__processor_id_t*)&this);276 }277 278 void ?{}(processor & this, const char name[], cluster & _cltr) {279 ( this.idle ){};280 ( this.terminated ){ 0 };281 ( this.runner ){};282 init( this, name, _cltr );283 284 __cfadbg_print_safe(runtime_core, "Kernel : Starting core %p\n", &this);285 286 this.stack = __create_pthread( &this.kernel_thread, __invoke_processor, (void *)&this );287 288 254 } 289 255 … … 303 269 304 270 free( this.stack ); 305 306 deinit( this );307 271 308 272 __atomic_fetch_sub( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); … … 354 318 355 319 __cfadbg_print_safe(runtime_core, "Kernel : core %p starting\n", this); 356 #if !defined(__CFA_NO_STATISTICS__) 357 if( this->print_halts ) { 358 __cfaabi_bits_print_safe( STDOUT_FILENO, "Processor : %d - %s (%p)\n", this->id, this->name, (void*)this); 359 } 360 #endif 320 321 // register the processor unless it's the main thread which is handled in the boot sequence 322 if(this != mainProcessor) { 323 this->id = doregister((__processor_id_t*)this); 324 #if !defined(__CFA_NO_STATISTICS__) 325 if( this->print_halts ) { 326 __cfaabi_bits_print_safe( STDOUT_FILENO, "Processor : %d - %s (%p)\n", this->id, this->name, (void*)this); 327 } 328 #endif 329 330 // Lock the RWlock so no-one pushes/pops while we are changing the queue 331 uint_fast32_t last_size = ready_mutate_lock(); 332 333 // Adjust the ready queue size 334 ready_queue_grow( this->cltr ); 335 336 // Unlock the RWlock 337 ready_mutate_unlock( last_size ); 338 } 361 339 362 340 { … … 397 375 V( this->terminated ); 398 376 399 if(this == mainProcessor) { 377 // unregister the processor unless it's the main thread which is handled in the boot sequence 378 if(this != mainProcessor) { 379 // Lock the RWlock so no-one pushes/pops while we are changing the queue 380 uint_fast32_t last_size = ready_mutate_lock(); 381 382 // Adjust the ready queue size 383 ready_queue_shrink( this->cltr ); 384 385 // Make sure we aren't on the idle queue 386 #if !defined(__CFA_NO_STATISTICS__) 387 bool removed = 388 #endif 389 unsafe_remove( this->cltr->idles, this ); 390 391 #if !defined(__CFA_NO_STATISTICS__) 392 if(removed) __tls_stats()->ready.sleep.exits++; 393 #endif 394 395 // Unlock the RWlock 396 ready_mutate_unlock( last_size ); 397 398 // Finally we don't need the read_lock any more 399 unregister((__processor_id_t*)this); 400 } 401 else { 400 402 // HACK : the coroutine context switch expects this_thread to be set 401 403 // and it make sense for it to be set in all other cases except here … … 857 859 858 860 void ?{}(processor & this) with( this ) { 859 ( this.idle ){}; 860 ( this.terminated ){ 0 }; 861 ( this.runner ){}; 862 init( this, "Main Processor", *mainCluster ); 861 name = "Main Processor"; 862 cltr = mainCluster; 863 terminated{ 0 }; 864 do_terminate = false; 865 preemption_alarm = 0p; 866 pending_preemption = false; 863 867 kernel_thread = pthread_self(); 868 id = -1u; 869 870 #if !defined(__CFA_NO_STATISTICS__) 871 print_stats = false; 872 print_halts = false; 873 #endif 864 874 865 875 runner{ &this }; 866 876 __cfadbg_print_safe(runtime_core, "Kernel : constructed main processor context %p\n", &runner); 877 878 __atomic_fetch_add( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); 867 879 } 868 880 … … 871 883 mainProcessor = (processor *)&storage_mainProcessor; 872 884 (*mainProcessor){}; 885 886 mainProcessor->id = doregister( (__processor_id_t*)mainProcessor); 873 887 874 888 //initialize the global state variables … … 930 944 kernel_stop_preemption(); 931 945 946 unregister((__processor_id_t*)mainProcessor); 947 932 948 // Destroy the main processor and its context in reverse order of construction 933 949 // These were manually constructed so we need manually destroy them 934 950 void ^?{}(processor & this) with( this ){ 935 deinit( this );936 937 951 /* paranoid */ verify( this.do_terminate == true ); 938 952 __atomic_fetch_sub( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); -
libcfa/src/concurrency/ready_queue.cfa
r54eb5ebd rf19fbbc 186 186 //======================================================================= 187 187 void ?{}(__ready_queue_t & this) with (this) { 188 lanes.data = 0p; 189 lanes.count = 0; 188 189 lanes.data = alloc(4); 190 for( i; 4 ) { 191 (lanes.data[i]){}; 192 } 193 lanes.count = 4; 194 snzi{ log2( lanes.count / 8 ) }; 190 195 } 191 196 192 197 void ^?{}(__ready_queue_t & this) with (this) { 193 verify( 0== lanes.count );198 verify( 4 == lanes.count ); 194 199 verify( !query( snzi ) ); 200 201 ^(snzi){}; 202 203 for( i; 4 ) { 204 ^(lanes.data[i]){}; 205 } 195 206 free(lanes.data); 196 207 } … … 484 495 } 485 496 486 #warning remove when alloc is fixed487 forall( dtype T | sized(T) )488 static inline T * correct_alloc( T ptr[], size_t dim ) {489 if( dim == 0 ) {490 free(ptr);491 return 0p;492 }493 T * temp = alloc( dim );494 if(ptr) {495 memcpy( temp, ptr, dim * sizeof(T));496 free(ptr);497 }498 return temp;499 }500 501 497 // Grow the ready queue 502 498 void ready_queue_grow (struct cluster * cltr) { … … 517 513 518 514 // Allocate new array (uses realloc and memcpies the data) 519 lanes.data = correct_alloc(lanes.data, ncount);515 lanes.data = alloc(lanes.data, ncount); 520 516 521 517 // Fix the moved data … … 562 558 size_t ocount = lanes.count; 563 559 // Check that we have some space left 564 if(ocount < 4) abort("Program attempted to destroy more Ready Queues than were created");560 if(ocount < 8) abort("Program attempted to destroy more Ready Queues than were created"); 565 561 566 562 // reduce the actual count so push doesn't use the old queues … … 604 600 605 601 // Allocate new array (uses realloc and memcpies the data) 606 lanes.data = correct_alloc(lanes.data, lanes.count);602 lanes.data = alloc(lanes.data, lanes.count); 607 603 608 604 // Fix the moved data -
libcfa/src/concurrency/snzi.hfa
r54eb5ebd rf19fbbc 120 120 //-------------------------------------------------- 121 121 // SNZI object 122 void ?{}( __snzi_t & this ) {123 this.mask = 0;124 this.root = 0;125 this.nodes = 0p;126 }127 128 122 void ?{}( __snzi_t & this, unsigned depth ) with( this ) { 129 123 mask = (1 << depth) - 1; -
libcfa/src/concurrency/stats.cfa
r54eb5ebd rf19fbbc 24 24 stats->ready.sleep.exits = 0; 25 25 26 #if defined( CFA_HAVE_LINUX_IO_URING_H)26 #if defined(HAVE_LINUX_IO_URING_H) 27 27 stats->io.submit_q.submit_avg.rdy = 0; 28 28 stats->io.submit_q.submit_avg.csm = 0; … … 59 59 __atomic_fetch_add( &cltr->ready.sleep.exits , proc->ready.sleep.exits , __ATOMIC_SEQ_CST ); 60 60 61 #if defined( CFA_HAVE_LINUX_IO_URING_H)61 #if defined(HAVE_LINUX_IO_URING_H) 62 62 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.rdy , proc->io.submit_q.submit_avg.rdy , __ATOMIC_SEQ_CST ); 63 63 __atomic_fetch_add( &cltr->io.submit_q.submit_avg.csm , proc->io.submit_q.submit_avg.csm , __ATOMIC_SEQ_CST ); … … 121 121 } 122 122 123 #if defined( CFA_HAVE_LINUX_IO_URING_H)123 #if defined(HAVE_LINUX_IO_URING_H) 124 124 if( flags & CFA_STATS_IO ) { 125 125 double avgrdy = ((double)io.submit_q.submit_avg.rdy) / io.submit_q.submit_avg.cnt; -
libcfa/src/concurrency/stats.hfa
r54eb5ebd rf19fbbc 11 11 enum { 12 12 CFA_STATS_READY_Q = 0x01, 13 #if defined( CFA_HAVE_LINUX_IO_URING_H)13 #if defined(HAVE_LINUX_IO_URING_H) 14 14 CFA_STATS_IO = 0x02, 15 15 #endif … … 64 64 }; 65 65 66 #if defined( CFA_HAVE_LINUX_IO_URING_H)66 #if defined(HAVE_LINUX_IO_URING_H) 67 67 struct __attribute__((aligned(64))) __stats_io_t{ 68 68 struct { … … 99 99 struct __attribute__((aligned(128))) __stats_t { 100 100 __stats_readQ_t ready; 101 #if defined( CFA_HAVE_LINUX_IO_URING_H)101 #if defined(HAVE_LINUX_IO_URING_H) 102 102 __stats_io_t io; 103 103 #endif
Note:
See TracChangeset
for help on using the changeset viewer.