Project

General

Profile

Bug #5532

Unneeded bcopy() during scrub

Added by Alexander Motin almost 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-01-13
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

According to profiler, bcopy() inside vdev_mirror_scrub_done() may consume up to 10% of CPU time when scrubbing. As I understand, that is absolutely not needed for single-device (non-redundant) vdevs.

Trivial patch fixes that in FreeBSD:

--- vdev_mirror.c       (revision 277095)
+++ vdev_mirror.c       (revision 277096)
@@ -435,7 +435,8 @@ vdev_mirror_io_start(zio_t *zio)
        mm = vdev_mirror_map_init(zio);

        if (zio->io_type == ZIO_TYPE_READ) {
-               if ((zio->io_flags & ZIO_FLAG_SCRUB) && !mm->mm_replacing) {
+               if ((zio->io_flags & ZIO_FLAG_SCRUB) && !mm->mm_replacing &&
+                   mm->mm_children > 1) {
                        /*
                         * For scrubbing reads we need to allocate a read
                         * buffer for each child and issue reads to all

History

#1

Updated by Josef Sipek almost 5 years ago

Interesting observation. Here's a link to the developer guide that'll help you get your change integrated: http://illumos.org/books/dev/integrating.html

I'd recommend using the openzfs developer mailing list as an additional place to get reviews: http://open-zfs.org/wiki/Mailing_list

Also available in: Atom PDF