• Jan Kara's avatar
    writeback: fix bandwidth estimate for spiky workload · 45a2966f
    Jan Kara authored
    Michael Stapelberg has reported that for workload with short big spikes of
    writes (GCC linker seem to trigger this frequently) the write throughput
    is heavily underestimated and tends to steadily sink until it reaches
    zero.  This has rather bad impact on writeback throttling (causing
    stalls).  The problem is that writeback throughput estimate gets updated
    at most once per 200 ms.  One update happens early after we submit pages
    for writeback (at that point writeout of only small fraction of pages is
    completed and thus observed throughput is tiny).  Next update happens only
    during the next write spike (updates happen only from inode writeback and
    dirty throttling code) and if that is more than 1s after previous spike,
    we decide system was idle and just ignore whatever was written until this
    moment.
    
    Fix the problem by making sure writeback throughput estimate is also
    updated shortly after writeback completes to get reasonable estimate of
    throughput for sp...
    45a2966f
backing-dev.c 27.2 KB