“Cache flush bypassed!” from fio

fio is a effective tool to test IO-performance of a block device (also file system).

Today, my colleague tell me fio has report “Cache flush bypassed!” which means all IO have bypass the device cache. But I can’t agree because the cache of a RAID card usually could only be change by specific tool (such as MegaCLi), but not a test tool.

By review the code of fio:

and the implementation for blockdev_invalidate_cache() is:

Therefore, the “Cache flush bypassed!” is not mean all IO will bypass the buffer of device, but actually means: “fio can’t flush the cache of device, so let’s ignore it”.
If you want to disable the DRAM cache on the RAID card, the correct way is set cache policy of RAID card to “Write Through”:

3 Comments

    Anon

    In the case of that message the cache being referred to is *Linux’s* page cache not the underlying controller’s/disk’s cache. As you point out fio has no control over that.

      RobinDong

      Thank you for your reply.
      But I still have a question: if fio want to “bypass” the *Linux’s* page cache, why don’t it just use Direct-IO instead of ioctl(fd, BLKFLSBUF) ?

      RobinDong

      By review the code of Linux kernel:

      It seems that fio is trying to flush the *buffer cache* of device by using ioctl(), not the page cache.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*