sbin/hammer: Move cache to tailq end when get_buffer_data() has a valid cache
commit63eacb74267a5a2776a215b529ab1a6f6939b80b
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 2 Jul 2017 18:30:08 +0000 (2 21:30 +0300)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 7 Jul 2017 05:43:00 +0000 (7 08:43 +0300)
tree056c1323e97eb4af5c2a476ecd2a7ee2e86dad22
parent750a1c766f441b0330f0cf27ee7a45120525c778
sbin/hammer: Move cache to tailq end when get_buffer_data() has a valid cache

This is the same as what get_buffer() does when new allocation
is not needed. This hasn't been done in get_buffer_data() when
the given non NULL buffer is the one to look for.

This seems to make newfs_hammer a bit faster, as the i/o size is
normally large enough to invoke eviction of HAMMER userspace buffer
cache while running, starting from the head of the tailq.

-- before this commit
 # for x in 1 2 3 4 5; do
 > (time newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null) 2>&1 | grep real
 > done
 real    0m20.291s
 real    0m20.574s
 real    0m22.347s
 real    0m21.562s
 real    0m20.991s

-- with this commit
 # for x in 1 2 3 4 5; do
 > (time newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null) 2>&1 | grep real
 > done
 real    0m18.023s
 real    0m18.064s
 real    0m18.104s
 real    0m17.646s
 real    0m18.310s
sbin/hammer/ondisk.c