Ignore:
Timestamp:
Apr 10, 2009, 12:58:26 AM (13 years ago)
Author:
charles
Message:

(trunk libT) experimental commit to reduce IO lag during fast downloads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r8175 r8193  
    8484    NOFILE_BUFFER = 512, /* the process' number of open files is
    8585                            globalMaxPeers + NOFILE_BUFFER */
    86 
    87     SYNC_INTERVAL = 15   /* (arbitrary number) how many seconds to go
    88                             between fsync calls for files in heavy use */
    8986};
    9087
     
    9794    int        fd;
    9895    uint64_t   date;
    99     time_t     syncAt;
    10096};
    10197
     
    463459        tr_strlcpy( o->filename, filename, sizeof( o->filename ) );
    464460        o->isWritable = doWrite;
    465         o->syncAt = time( NULL ) + SYNC_INTERVAL;
    466461    }
    467462
     
    491486        if( o->closeWhenDone )
    492487            TrCloseFile( i );
    493         else if( o->syncAt <= time( NULL ) ) {
    494             dbgmsg( "fsync()ing file '%s' in slot #%d", o->filename, i );
    495             //fsync( o->fd );
    496 #ifdef HAVE_POSIX_FADVISE
    497             /* TODO: test performance with and without this */
    498             posix_fadvise( o->fd, 0, 0, POSIX_FADV_DONTNEED );
    499 #endif
    500             o->syncAt = time( NULL ) + SYNC_INTERVAL;
    501         }
    502488
    503489        break;
Note: See TracChangeset for help on using the changeset viewer.