In dmu_zfetch_stream_reclaim() replace division with multiplication and

move it out of the loop and lock.
This commit is contained in:
Alexander Motin
2014-01-03 18:44:37 +00:00
parent 9fa0eb8b8f
commit ce05e707c4
@@ -604,14 +604,16 @@ static zstream_t *
dmu_zfetch_stream_reclaim(zfetch_t *zf)
{
zstream_t *zs;
clock_t ticks;
ticks = zfetch_min_sec_reap * hz;
if (! rw_tryenter(&zf->zf_rwlock, RW_WRITER))
return (0);
for (zs = list_head(&zf->zf_stream); zs;
zs = list_next(&zf->zf_stream, zs)) {
if (((ddi_get_lbolt() - zs->zst_last)/hz) > zfetch_min_sec_reap)
if (ddi_get_lbolt() - zs->zst_last > ticks)
break;
}