Changes in / [7b91c0e:1adab3e]
- Files:
-
- 4 deleted
- 4 edited
-
benchmark/io/http/http_ring.cpp (deleted)
-
benchmark/io/http/main.cfa (modified) (2 diffs)
-
benchmark/io/http/options.cfa (modified) (6 diffs)
-
benchmark/io/setup.sh (deleted)
-
example/io/attach-block.c (deleted)
-
example/io/attach-end.c (deleted)
-
libcfa/src/concurrency/io.cfa (modified) (6 diffs)
-
libcfa/src/concurrency/io/setup.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/main.cfa
r7b91c0e r1adab3e 6 6 #include <unistd.h> 7 7 extern "C" { 8 #include <signal.h>9 8 #include <sys/socket.h> 10 9 #include <netinet/in.h> … … 79 78 //=============================================================================================' 80 79 int main( int argc, char * argv[] ) { 81 __sighandler_t s = 1p;82 signal(SIGPIPE, s);83 84 80 //=================== 85 81 // Parse args -
benchmark/io/http/options.cfa
r7b91c0e r1adab3e 9 9 } 10 10 11 #include <bitmanip.hfa>12 11 #include <fstream.hfa> 13 12 #include <kernel.hfa> … … 52 51 bool iokpoll = false; 53 52 unsigned sublen = 16; 54 unsigned nentries = 16;55 56 53 57 54 static cfa_option opt[] = { … … 71 68 { 'i', "kpollcomplete", "If set, cluster uses IORING_SETUP_IOPOLL", iokpoll, parse_settrue }, 72 69 {'\0', "submitlength", "Max number of submitions that can be submitted together", sublen }, 73 {'\0', "numentries", "Number of I/O entries", nentries },74 70 75 71 }; … … 78 74 char **left; 79 75 parse_args( argc, argv, opt, opt_cnt, "[OPTIONS]... [PATH]\ncforall http server", left ); 80 81 if( !is_pow2(nentries) ) {82 unsigned v = nentries;83 v--;84 v |= v >> 1;85 v |= v >> 2;86 v |= v >> 4;87 v |= v >> 8;88 v |= v >> 16;89 v++;90 serr | "Warning: num_entries not a power of 2" | '(' | nentries | ')' | "raising to " | v;91 nentries = v;92 }93 options.clopts.params.num_entries = nentries;94 76 95 77 options.clopts.params.poller_submits = subthrd; … … 112 94 options.clopts.params.num_ready = sublen; 113 95 114 if( left[0] == 0p ) { return ; }96 if( left[0] == 0p ) { return "."; } 115 97 116 98 const char * path = left[0]; … … 118 100 119 101 if( left[0] != 0p ) { 120 serr | "Too many trailing arguments!" | '\'' | path | '\''; 121 while(left[0] != 0p) { 122 serr | " - " | left[0]; 123 left++; 124 } 102 serr | "Too many trailing arguments!"; 125 103 exit(EXIT_FAILURE); 126 104 } -
libcfa/src/concurrency/io.cfa
r7b91c0e r1adab3e 41 41 #include "io/types.hfa" 42 42 43 __attribute__((unused))static const char * opcodes[] = {43 static const char * opcodes[] = { 44 44 "OP_NOP", 45 45 "OP_READV", … … 173 173 __cfadbg_print_safe(io_core, "Kernel I/O : IO_URING enter %d %u %u\n", ring.fd, to_submit, flags); 174 174 ret = syscall( __NR_io_uring_enter, ring.fd, to_submit, 0, flags, (sigset_t *)0p, _NSIG / 8); 175 __cfadbg_print_safe(io_core, "Kernel I/O : IO_URING %d returned %d\n", ring.fd, ret);176 177 175 if( ret < 0 ) { 178 176 switch((int)errno) { 179 177 case EAGAIN: 180 178 case EINTR: 181 case EBUSY:182 179 ret = -1; 183 180 break; … … 468 465 sqe->flags, 469 466 sqe->ioprio, 470 (void*)sqe->off,471 (void*)sqe->addr,467 sqe->off, 468 sqe->addr, 472 469 sqe->len, 473 470 sqe->accept_flags, … … 494 491 } 495 492 else if( ring.eager_submits ) { 496 __ attribute__((unused)) __u32 picked = __submit_to_ready_array( ring, idx, mask );493 __u32 picked = __submit_to_ready_array( ring, idx, mask ); 497 494 498 495 #if defined(LEADER_LOCK) … … 632 629 sqe->flags, 633 630 sqe->ioprio, 634 (void*)sqe->off,635 (void*)sqe->addr,631 sqe->off, 632 sqe->addr, 636 633 sqe->len, 637 634 sqe->accept_flags, … … 645 642 __atomic_thread_fence( __ATOMIC_SEQ_CST ); 646 643 // Release the consumed SQEs 647 648 644 __release_consumed_submission( ring ); 649 645 // ring.submit_q.sqes[idx].user_data = 3ul64; -
libcfa/src/concurrency/io/setup.cfa
r7b91c0e r1adab3e 549 549 int ret = syscall( __NR_io_uring_register, ctx.thrd.ring->fd, IORING_REGISTER_FILES, files, count ); 550 550 if( ret < 0 ) { 551 abort( "KERNEL ERROR: IO_URING REGISTER- (%d) %s\n", (int)errno, strerror(errno) );551 abort( "KERNEL ERROR: IO_URING SYSCALL - (%d) %s\n", (int)errno, strerror(errno) ); 552 552 } 553 553
Note:
See TracChangeset
for help on using the changeset viewer.