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