From a8b2e30685c9214ccfd0181977540e080340df4e Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Thu, 21 Dec 2017 12:13:06 -0500 Subject: Support re-prioritizing asynchronous prefetches When sequential scrubs were merged, all calls to arc_read() (including prefetch IOs) were given ZIO_PRIORITY_ASYNC_READ. Unfortunately, this behaves badly with an existing issue where prefetch IOs cannot be re-prioritized after the issue. The result is that synchronous reads end up in the same vdev_queue as the scrub IOs and can have (in some workloads) multiple seconds of latency. This patch incorporates 2 changes. The first ensures that all scrub IOs are given ZIO_PRIORITY_SCRUB to allow the vdev_queue code to differentiate between these I/Os and user prefetches. Second, this patch introduces zio_change_priority() to provide the missing capability to upgrade a zio's priority. Reviewed by: George Wilson Reviewed-by: Brian Behlendorf Signed-off-by: Tom Caputi Closes #6921 Closes #6926 --- tests/zfs-tests/tests/perf/scripts/prefetch_io.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/zfs-tests/tests/perf/scripts/prefetch_io.sh b/tests/zfs-tests/tests/perf/scripts/prefetch_io.sh index 85e7d940a..75bf08f4b 100755 --- a/tests/zfs-tests/tests/perf/scripts/prefetch_io.sh +++ b/tests/zfs-tests/tests/perf/scripts/prefetch_io.sh @@ -41,9 +41,9 @@ function get_prefetched_demand_reads echo $demand_reads } -function get_sync_wait_for_async +function get_async_upgrade_sync { - typeset -l sync_wait=`awk '$1 == "sync_wait_for_async" \ + typeset -l sync_wait=`awk '$1 == "async_upgrade_sync" \ { print $3 }' $zfs_kstats/arcstats` echo $sync_wait @@ -59,7 +59,7 @@ poolname=$1 interval=$2 prefetch_ios=$(get_prefetch_ios) prefetched_demand_reads=$(get_prefetched_demand_reads) -sync_wait_for_async=$(get_sync_wait_for_async) +async_upgrade_sync=$(get_async_upgrade_sync) while true do @@ -73,10 +73,10 @@ do $(( $new_prefetched_demand_reads - $prefetched_demand_reads )) prefetched_demand_reads=$new_prefetched_demand_reads - new_sync_wait_for_async=$(get_sync_wait_for_async) - printf "%-24s\t%u\n" "sync_wait_for_async" \ - $(( $new_sync_wait_for_async - $sync_wait_for_async )) - sync_wait_for_async=$new_sync_wait_for_async + new_async_upgrade_sync=$(get_async_upgrade_sync) + printf "%-24s\t%u\n" "async_upgrade_sync" \ + $(( $new_async_upgrade_sync - $async_upgrade_sync )) + async_upgrade_sync=$new_async_upgrade_sync sleep $interval done -- cgit v1.2.3