diff options
author | Anand Jain <anand.jain@oracle.com> | 2020-10-28 14:14:46 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-12-08 15:53:44 +0100 |
commit | 33fd2f714cde793b337b4ca6aaf3a8c68675d74f (patch) | |
tree | 2992c7c3fcd3a34394677cc7a82ea0ba3d0c1eca /fs/btrfs/volumes.h | |
parent | btrfs: add helper for string match ignoring leading/trailing whitespace (diff) | |
download | linux-33fd2f714cde793b337b4ca6aaf3a8c68675d74f.tar.xz linux-33fd2f714cde793b337b4ca6aaf3a8c68675d74f.zip |
btrfs: create read policy framework
As of now, we use the pid method to read striped mirrored data, which
means process id determines the stripe id to read. This type of routing
typically helps in a system with many small independent processes tying
to read random data. On the other hand, the pid based read IO policy is
inefficient because if there is a single process trying to read a large
file, the overall disk bandwidth remains underutilized.
So this patch introduces a read policy framework so that we could add
more read policies, such as IO routing based on the device's wait-queue
or manual when we have a read-preferred device or a policy based on the
target storage caching.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 232f02bd214f..34fd440fd30b 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -211,6 +211,16 @@ enum btrfs_chunk_allocation_policy { BTRFS_CHUNK_ALLOC_REGULAR, }; +/* + * Read policies for mirrored block group profiles, read picks the stripe based + * on these policies. + */ +enum btrfs_read_policy { + /* Use process PID to choose the stripe */ + BTRFS_READ_POLICY_PID, + BTRFS_NR_READ_POLICY, +}; + struct btrfs_fs_devices { u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ u8 metadata_uuid[BTRFS_FSID_SIZE]; @@ -264,6 +274,9 @@ struct btrfs_fs_devices { struct completion kobj_unregister; enum btrfs_chunk_allocation_policy chunk_alloc_policy; + + /* Policy used to read the mirrored stripes */ + enum btrfs_read_policy read_policy; }; #define BTRFS_BIO_INLINE_CSUM_SIZE 64 |