Go to file
Stefan Behrens 4739e7332c Btrfs-progs: make scrub IO priority configurable
The btrfs tool is changed in order to support command line parameters
to configure the IO priority of the scrub tasks. Also the default is
changed. The default IO priority for scrub is the idle class now.

The behavior is the same as when one would type
'ionice ... btrfs scrub start ...' or 'ionice ... btrfs scrub resume ...'
(without this patch applied).
The only reason for adding this to the btrfs tool is that it was not
documented and not obvious that it worked like this, that all internal
scrub tasks inherited the IO priority values of the btrfs tool that is
starting or resuming the scrub operation.

Note that after applying the patch it is no longer possible to set
the IO priority using ionice since the btrfs tool always configures
the priority in order to run in the idle class by default.

Some basic performance measurements have been done with the goal to
measure which IO priority for scrub gives the best overall disk data
throughput. The kernel was configured to use the CFQ IO scheduler
with default configuration and without support for throttling. The
summary is, that the more the disk head movements are avoided, the
faster the overall disk transfer capacity is, which is not really a
big surprise. Therefore it makes sense that the best data throughput
was measured setting the scrub IO priority and the scrub readahead
IO priority to the idle class priority. Running with idle class IO
priority means that scrub and scrub readahead IO is paused while
other tasks access the disk. Doing the tasks one after the other
instead of concurrently avoids many disk head movements. The
overall data throughput of rotating disks is improved this way.

However, if it is desired to have the scrub task done within a
reasonable time, and if at the same time the filesystem is heavily
loaded, the idle IO priority should be avoided. Otherwise the scrub
operation will never take place and thus never terminate.

The best effort IO priority class with the subclass 7 (the lowest
one in the best effort class) is recommended in the case of always
heavily loaded hard disks. If the filesystem is not loaded all the
time and leaves some idle slots for scrub, the idle class IO priority
is recommended. The idle class now is the default if the scrub
operation is started with the btrfs-progs tools.

Note that the patch that sets the scrub readahead IO priority to the
idle class is a seperate patch, this needs to be done in the kernel.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
2013-03-19 18:23:58 +01:00
man Btrfs-progs: make scrub IO priority configurable 2013-03-19 18:23:58 +01:00
.gitignore Removing btrfsctl, btrfs-vol, btrfs-show 2013-03-19 18:21:41 +01:00
.hgignore Add .hgignore file to ignore verison.h 2008-07-23 11:36:13 -04:00
.hgtags Added tag v0.16 for changeset 2b26e4f8c71e 2008-08-04 15:46:36 -04:00
COPYING fix COPYING 2007-06-12 15:41:08 -04:00
INSTALL Removing btrfsctl, btrfs-vol, btrfs-show 2013-03-19 18:21:41 +01:00
Makefile btrfs-progs: makefile: clean static targets 2013-03-19 18:21:59 +01:00
bcp Btrfs-progs: Correct path munging in bcp 2011-10-25 09:18:58 -04:00
btrfs-corrupt-block.c Add basic RAID[56] support 2013-02-01 14:22:07 -05:00
btrfs-defrag.c new util: 'btrfs' 2010-03-11 13:45:47 -05:00
btrfs-image.c btrfs-progs: free allocated metadump structure on restore failure 2013-03-10 15:49:15 +01:00
btrfs-list.c btrfs-progs: Tidy up resolve_root 2013-02-27 14:40:02 +01:00
btrfs-list.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
btrfs-map-logical.c Add basic RAID[56] support 2013-02-01 14:22:07 -05:00
btrfs-select-super.c btrfs-progs: Handle errors returned from open_ctree 2013-01-21 18:27:54 +01:00
btrfs-show-super.c btrfs-progs: don't call close on error fd 2013-02-27 14:39:45 +01:00
btrfs-zero-log.c btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
btrfs.c Btrfs-progs: add restore command to btrfs 2013-02-12 23:46:15 +01:00
btrfstune.c btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
calc-size.c btrfs-progs: add a recovery utility to pull files from damanged filesystems 2011-10-27 12:49:54 -04:00
cmds-balance.c btrfs-progs: initialize save_ptr prior to strtok_r 2013-02-27 14:40:09 +01:00
cmds-check.c btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
cmds-device.c btrfs-progs: rework get_fs_info to remove side effects 2013-03-12 17:07:40 +01:00
cmds-filesystem.c btrfs-progs: defrag return zero on success 2013-03-18 19:42:29 +01:00
cmds-inspect.c btrfs-progs: Fix pointer math in __ino_to_path_fd 2013-02-19 11:15:30 +01:00
cmds-qgroup.c Btrfs-progs: output the error reason when qgroup_show fails 2013-02-27 16:13:20 +01:00
cmds-quota.c Btrfs-progs: move open_file_or_dir() to utils.c 2013-01-30 00:40:35 +01:00
cmds-receive.c btrfs-progs: fix overflows of ioctl name args 2013-02-05 16:09:41 -08:00
cmds-replace.c btrfs-progs: rework get_fs_info to remove side effects 2013-03-12 17:07:40 +01:00
cmds-restore.c Btrfs-progs: give restore a list roots option 2013-03-18 18:14:19 +01:00
cmds-scrub.c Btrfs-progs: make scrub IO priority configurable 2013-03-19 18:23:58 +01:00
cmds-send.c btrfs-progs: initialize pipefd[] for error path 2013-02-05 16:09:41 -08:00
cmds-subvolume.c btrfs-progs: Free resources when returning error from cmd_subvol_create() 2013-03-10 16:03:48 +01:00
commands.h Btrfs-progs: add restore command to btrfs 2013-02-12 23:46:15 +01:00
convert.c btrfs-progs: convert: access name_len and file_type the old way 2013-03-18 19:33:42 +01:00
crc32c.c Btrfs-progs: fix several complie warning 2012-10-04 16:26:31 -04:00
crc32c.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
ctree.c btrfs-progs: impossible BUG_ON meant to test empty 2013-02-05 16:09:39 -08:00
ctree.h btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
debug-tree.c btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
dir-item.c Fix unused-but-set errors in gcc-4.6 2011-10-25 09:18:32 -04:00
dir-test.c btrfs-progs: Handle errors returned from open_ctree 2013-01-21 18:27:54 +01:00
disk-io.c Btrfs-progs: fix memory leaks on cleanup 2013-03-18 19:44:32 +01:00
disk-io.h Merge branch 'cov-fixes-v1-integration-20130201' of http://git.zabbo.net/cgit/btrfs-progs into merged 2013-02-06 12:51:58 -05:00
extent-cache.c Fix unused-but-set errors in gcc-4.6 2011-10-25 09:18:32 -04:00
extent-cache.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
extent-tree.c Btrfs-progs: fix memory leaks on cleanup 2013-03-18 19:44:32 +01:00
extent_io.c btrfs-progs: make libbtrfs usable from C++ 2013-02-19 11:15:30 +01:00
extent_io.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
file-item.c btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
find-root.c Btrfs-progs: alloc our super copy in btrfs-find-root 2013-03-12 16:26:42 +01:00
hash.h Switch btrfs_name_hash() to crc32c 2008-08-20 20:11:23 -04:00
hasher.c Unaligned access fixes 2008-02-15 11:19:58 -05:00
help.c Btrfs-progs: allow multi-line command group synopsis 2012-02-08 18:55:51 +02:00
inode-item.c btrfs-progs new dir index support 2008-07-24 12:13:32 -04:00
inode-map.c btrfs-progs: Fix printf format casting errors 2008-04-01 10:52:22 -04:00
ioctl-test.c Test the additional ioctl. 2011-10-25 09:18:58 -04:00
ioctl.h Btrfs-progs: Change the label of a mounted file system 2013-02-26 19:23:32 +01:00
kerncompat.h Merge branch 'cov-fixes-v1-integration-20130201' of http://git.zabbo.net/cgit/btrfs-progs into merged 2013-02-06 12:51:58 -05:00
list.h btrfs-progs: make libbtrfs usable from C++ 2013-02-19 11:15:30 +01:00
mkfs.c btrfs-progs: document force option in mkfs usage(); add long opt 2013-03-14 23:46:18 +01:00
print-tree.c btrfs-progs: break after printing FREE_INO 2013-02-05 16:09:39 -08:00
print-tree.h Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
qgroup.c Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull 2013-01-21 18:28:01 +01:00
qgroup.h Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull 2013-01-21 18:28:01 +01:00
quick-test.c btrfs-progs: Handle errors returned from open_ctree 2013-01-21 18:27:54 +01:00
radix-tree.c Make btrfs-progs compile with -fstrict-aliasing (included in -O2) again. 2007-09-14 10:31:06 -04:00
radix-tree.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
raid6.c btrfs-progs: include kerncompat.h in raid6.c, define __attribute_const__ 2013-02-03 12:39:16 -05:00
random-test.c btrfs-progs: Handle errors returned from open_ctree 2013-01-21 18:27:54 +01:00
rbtree.c Stop using radix trees to record pending allocations 2007-10-15 16:25:04 -04:00
rbtree.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
repair.c Btrfsck: add the ability to prune corrupt extent allocation tree blocks 2012-02-21 14:37:21 -05:00
repair.h Btrfsck: add the ability to prune corrupt extent allocation tree blocks 2012-02-21 14:37:21 -05:00
root-tree.c btrfs-progs: code cleanup for root-tree.c/btrfs_del_root 2013-02-07 01:19:50 +01:00
send-stream.c btrfs-progs: Add support for BTRFS_SEND_FLAG_NO_FILE_DATA 2013-02-12 23:46:15 +01:00
send-stream.h btrfs-progs: make libbtrfs usable from C++ 2013-02-19 11:15:30 +01:00
send-utils.c Btrfs-progs: bugfix for subvolume parent determination in btrfs send 2013-01-21 18:52:48 +01:00
send-utils.h btrfs-progs: libify some parts of btrfs-progs 2013-02-27 15:24:25 +01:00
send.h btrfs-progs: make libbtrfs usable from C++ 2013-02-19 11:15:30 +01:00
show-blocks Fix showblocks to display different colors for different metadata roots 2009-03-09 13:00:44 -04:00
transaction.h btrfs-progs: add malloc check in transaction.h/btrfs_start_transaction 2013-01-18 18:27:21 +01:00
utils.c btrfs-progs: print errno string when /dev/btrfs-control open fails 2013-03-14 23:43:04 +01:00
utils.h btrfs-progs: rework get_fs_info to remove side effects 2013-03-12 17:07:40 +01:00
version.sh version.sh: fix version when built from tarball 2013-01-17 18:13:03 +01:00
volumes.c btrfs-progs: separate super_copy out of fs_info 2013-03-10 16:12:21 +01:00
volumes.h Merge branch 'for-chris' of git://repo.or.cz/btrfs-progs-unstable/devel into raid56 2013-02-06 12:42:24 -05:00