Problem: The current scrub algorithm is not rotational media friendly; it generally produces a random read workload and become limited on the underlying storage system's seek latency.
The following has been copied from Matt Ahrens' reply on the mailing list, here: https://www.listbox.com/member/archive/274414/2016/07/sort/time_rev/page/1/entry/1:30/20160709172505:98792D9A-461B-11E6-905A-93F52D8D822E/
We had an intern work on "sorted scrub" last year. Essentially the idea was to read the metadata to gather into memory all the BP's that need to be scrubbed, sort them by DVA (i.e. offset on disk) and then issue the scrub i/os in that sorted order. However, memory can't hold all of the BP's, so we do multiple passes over the metadata, each pass gathering the next chunk of BP's. This code is implemented and seems to work but probably needs some more testing and code cleanup.