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