Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/options.cfa

    r2cd784a ra6b587f  
    1313#include <kernel.hfa>
    1414#include <parseargs.hfa>
    15 #include <stdlib.hfa>
    1615
    1716#include <stdlib.h>
     
    2019Options options @= {
    2120        false, // log
    22         false, // stats
    2321
    2422        { // file_cache
     
    3836
    3937        { // cluster
    40                 1,     // nclusters;
    4138                1,     // nprocs;
    4239                1,     // nworkers;
     
    4946
    5047void 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;
    5454        unsigned nentries = 16;
    55         bool isolate = false;
    5655
    5756
     
    6059                { 'c', "cpus",           "Number of processors to use", options.clopts.nprocs},
    6160                { 't', "threads",        "Number of worker threads to use", options.clopts.nworkers},
    62                 {'\0', "isolate",        "Create one cluster per processor", isolate, parse_settrue},
    6361                {'\0', "log",            "Enable logs", options.log, parse_settrue},
    64                 {'\0', "stats",          "Enable statistics", options.stats, parse_settrue},
    6562                {'\0', "accept-backlog", "Maximum number of pending accepts", options.socket.backlog},
    6663                {'\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},
     
    6865                {'\0', "cache-size",     "Size of the cache to use, if set to small, will uses closes power of 2", options.file_cache.size },
    6966                {'\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 },
    7474
    7575        };
     
    9191                nentries = v;
    9292        }
    93         if(isolate) {
    94                 options.clopts.nclusters = options.clopts.nprocs;
    95                 options.clopts.nprocs = 1;
    96         }
    9793        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;
    103100        }
    104101
     102        if( sqkpoll ) {
     103                options.clopts.params.poll_submit = true;
     104                options.file_cache.fixed_fds = true;
     105        }
    105106
    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        }
    109111
    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;
    117113
    118114        if( left[0] == 0p ) { return; }
Note: See TracChangeset for help on using the changeset viewer.