Changes in benchmark/io/http/options.cfa [2cd784a:a6b587f]
- File:
-
- 1 edited
-
benchmark/io/http/options.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/options.cfa
r2cd784a ra6b587f 13 13 #include <kernel.hfa> 14 14 #include <parseargs.hfa> 15 #include <stdlib.hfa>16 15 17 16 #include <stdlib.h> … … 20 19 Options options @= { 21 20 false, // log 22 false, // stats23 21 24 22 { // file_cache … … 38 36 39 37 { // cluster 40 1, // nclusters;41 38 1, // nprocs; 42 39 1, // nworkers; … … 49 46 50 47 void parse_options( int argc, char * argv[] ) { 51 // bool fixedfd = false; 52 // bool sqkpoll = false; 53 // bool iokpoll = false; 48 bool subthrd = false; 49 bool eagrsub = false; 50 bool fixedfd = false; 51 bool sqkpoll = false; 52 bool iokpoll = false; 53 unsigned sublen = 16; 54 54 unsigned nentries = 16; 55 bool isolate = false;56 55 57 56 … … 60 59 { 'c', "cpus", "Number of processors to use", options.clopts.nprocs}, 61 60 { 't', "threads", "Number of worker threads to use", options.clopts.nworkers}, 62 {'\0', "isolate", "Create one cluster per processor", isolate, parse_settrue},63 61 {'\0', "log", "Enable logs", options.log, parse_settrue}, 64 {'\0', "stats", "Enable statistics", options.stats, parse_settrue},65 62 {'\0', "accept-backlog", "Maximum number of pending accepts", options.socket.backlog}, 66 63 {'\0', "request_len", "Maximum number of bytes in the http request, requests with more data will be answered with Http Code 414", options.socket.buflen}, … … 68 65 {'\0', "cache-size", "Size of the cache to use, if set to small, will uses closes power of 2", options.file_cache.size }, 69 66 {'\0', "list-files", "List the files in the specified path and exit", options.file_cache.list, parse_settrue }, 70 // { 'f', "fixed-fds", "If set, files are open eagerly and pre-registered with the cluster", fixedfd, parse_settrue}, 71 // { 'k', "kpollsubmit", "If set, cluster uses IORING_SETUP_SQPOLL, implies -f", sqkpoll, parse_settrue }, 72 // { 'i', "kpollcomplete", "If set, cluster uses IORING_SETUP_IOPOLL", iokpoll, parse_settrue }, 73 {'e', "numentries", "Number of I/O entries", nentries }, 67 { 's', "submitthread", "If set, cluster uses polling thread to submit I/O", subthrd, parse_settrue }, 68 { 'e', "eagersubmit", "If set, cluster submits I/O eagerly but still aggregates submits", eagrsub, parse_settrue}, 69 { 'f', "fixed-fds", "If set, files are open eagerly and pre-registered with the cluster", fixedfd, parse_settrue}, 70 { 'k', "kpollsubmit", "If set, cluster uses IORING_SETUP_SQPOLL, implies -f", sqkpoll, parse_settrue }, 71 { 'i', "kpollcomplete", "If set, cluster uses IORING_SETUP_IOPOLL", iokpoll, parse_settrue }, 72 {'\0', "submitlength", "Max number of submitions that can be submitted together", sublen }, 73 {'\0', "numentries", "Number of I/O entries", nentries }, 74 74 75 75 }; … … 91 91 nentries = v; 92 92 } 93 if(isolate) {94 options.clopts.nclusters = options.clopts.nprocs;95 options.clopts.nprocs = 1;96 }97 93 options.clopts.params.num_entries = nentries; 98 options.clopts.instance = alloc(options.clopts.nclusters); 99 options.clopts.thrd_cnt = alloc(options.clopts.nclusters); 100 options.clopts.cltr_cnt = 0; 101 for(i; options.clopts.nclusters) { 102 options.clopts.thrd_cnt[i] = 0; 94 95 options.clopts.params.poller_submits = subthrd; 96 options.clopts.params.eager_submits = eagrsub; 97 98 if( fixedfd ) { 99 options.file_cache.fixed_fds = true; 103 100 } 104 101 102 if( sqkpoll ) { 103 options.clopts.params.poll_submit = true; 104 options.file_cache.fixed_fds = true; 105 } 105 106 106 // if( fixedfd ) { 107 // options.file_cache.fixed_fds = true; 108 // } 107 if( iokpoll ) { 108 options.clopts.params.poll_complete = true; 109 options.file_cache.open_flags |= O_DIRECT; 110 } 109 111 110 // if( sqkpoll ) { 111 // options.file_cache.fixed_fds = true; 112 // } 113 114 // if( iokpoll ) { 115 // options.file_cache.open_flags |= O_DIRECT; 116 // } 112 options.clopts.params.num_ready = sublen; 117 113 118 114 if( left[0] == 0p ) { return; }
Note:
See TracChangeset
for help on using the changeset viewer.