Changeset f258932


Ignore:
Timestamp:
09/16/11 10:14:11 (10 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
2cf2c2d
Parents:
24ca459
Message:
  • Bumped default number of IO buffers up to a total of 50 MB
  • Added a LIBTRACEIO option to adjust the number of IO buffers
Location:
lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/ior-thread.c

    r948ed9a rf258932  
    5959/* 1MB Buffer */
    6060#define BUFFERSIZE (1024*1024)
    61 #define BUFFERS 5
    6261
    6362extern io_source_t thread_source;
     
    7271struct state_t {
    7372        /* The collection of buffers (or slices) */
    74         struct buffer_t buffer[BUFFERS];
     73        struct buffer_t *buffer;
    7574        /* The index of the buffer to read into next */
    7675        int in_buffer;
     
    151150
    152151                /* Move on to the next buffer */
    153                 buffer=(buffer+1) % BUFFERS;
     152                buffer=(buffer+1) % max_buffers;
    154153
    155154        } while(running);
     
    177176        state->source = &thread_source;
    178177
     178        DATA(state)->buffer = (struct buffer_t *)malloc(sizeof(struct buffer_t) * max_buffers);
    179179        DATA(state)->in_buffer = 0;
    180180        DATA(state)->offset = 0;
     
    245245                        INBUFFER(state).state = EMPTY;
    246246                        pthread_cond_signal(&DATA(state)->space_avail);
    247                         newbuffer = (newbuffer+1) % BUFFERS;
     247                        newbuffer = (newbuffer+1) % max_buffers;
    248248                        DATA(state)->offset = 0;
    249249                }
  • lib/wandio.c

    ra8d184f rf258932  
    5656int force_directio_read = 0;
    5757unsigned int use_threads = -1;
     58unsigned int max_buffers = 50;
    5859
    5960uint64_t read_waits = 0;
     
    8384        else if (strncmp(option,"threads=",8) == 0)
    8485                use_threads = atoi(option+8);
     86        else if (strncmp(option,"buffers=",8) == 0)
     87                max_buffers = atoi(option+8);
    8588        else {
    8689                fprintf(stderr,"Unknown libtraceio debug option '%s'\n", option);
  • lib/wandio.h

    r948ed9a rf258932  
    294294extern uint64_t read_waits;
    295295extern unsigned int use_threads;
     296extern unsigned int max_buffers;
    296297/* @} */
    297298
Note: See TracChangeset for help on using the changeset viewer.