]> git.hungrycats.org Git - linux/commitdiff
Revert "btrfs: add read policy burst"
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 5 Dec 2021 08:35:55 +0000 (03:35 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 5 Dec 2021 08:35:55 +0000 (03:35 -0500)
This reverts commit e548a212d571fb804782fe4486b6862f1272f039.

fs/btrfs/sysfs.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h

index 57b0184bf80bfb81d6a0bd96d5e7dc28f8ea4b0a..7ae9a8fc36e79d74b5a42e2dd3d7077ef31cb16a 100644 (file)
@@ -1085,7 +1085,7 @@ static bool strmatch(const char *buffer, const char *string)
 
 /* Must follow the order as in enum btrfs_read_policy */
 static const char * const btrfs_read_policy_name[] = { "pid", "latency",
-       "device", "load", "roundrobin", "random", "burst" };
+       "device", "load", "roundrobin", "random" };
 
 static ssize_t btrfs_read_policy_show(struct kobject *kobj,
                                      struct kobj_attribute *a, char *buf)
index cc5f83f02667af4443175b968bff9a6c6b1e3e9f..b3280b755b5ec9096eb460bd90a4ed0414857414 100644 (file)
@@ -379,8 +379,6 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid,
        fs_devs->read_policy_load_rotating_inc =
                BTRFS_DEFAULT_READ_POLICY_LOAD_ROTATING_INC;
 
-       fs_devs->read_policy_burst = BTRFS_DEFAULT_READ_POLICY_RR_BURST;
-
        return fs_devs;
 }
 
@@ -6195,31 +6193,6 @@ out:
        return preferred_mirror;
 }
 
-static int policy_burst(struct btrfs_fs_info *fs_info, struct map_lookup *map,
-                       int first, int num_stripes)
-{
-       int index;
-       const u32 burst = READ_ONCE(fs_info->fs_devices->read_policy_burst);
-
-       for (index = first; index < first + num_stripes; index++) {
-               struct btrfs_device *device = map->stripes[index].dev;
-
-               if (device->read_burst < burst) {
-                       device->read_burst++;
-                       return index;
-               }
-       }
-
-       /* No suitable device found, reset state */
-       for (index = first; index < first + num_stripes; index++) {
-               struct btrfs_device *device = map->stripes[index].dev;
-
-               device->read_burst = 0;
-       }
-
-       return first;
-}
-
 static int find_live_mirror(struct btrfs_fs_info *fs_info,
                            struct map_lookup *map, int first,
                            int dev_replace_is_ongoing)
@@ -6267,9 +6240,6 @@ static int find_live_mirror(struct btrfs_fs_info *fs_info,
        case BTRFS_READ_POLICY_RANDOM:
                preferred_mirror = (first + prandom_u32_max(num_stripes)) % num_stripes;
                break;
-       case BTRFS_READ_POLICY_RR_BURST:
-               preferred_mirror = policy_burst(fs_info, map, first, num_stripes);
-               break;
        }
 
        if (dev_replace_is_ongoing &&
index 0e2a05a176845286dd2654b8d1b10eaf29eba8ef..4f216558eff01e2f7313a6f0b6c1707f20b0441f 100644 (file)
@@ -149,9 +149,6 @@ struct btrfs_device {
 
        /* I/O stats for raid1 mirror selection */
        struct percpu_counter inflight;
-
-       /* Burst stats for policy burst */
-       u32 read_burst;
 };
 
 /*
@@ -243,8 +240,6 @@ enum btrfs_read_policy {
        BTRFS_READ_POLICY_ROUNDROBIN,
        /* Select mirror randomly */
        BTRFS_READ_POLICY_RANDOM,
-       /* Round robin with configurable burst to a device before switching */
-       BTRFS_READ_POLICY_RR_BURST,
        BTRFS_NR_READ_POLICY,
 };
 
@@ -259,9 +254,6 @@ enum btrfs_read_policy {
 /* Default duration in the roundrobin read policy (100 ms) */
 #define BTRFS_DEFAULT_READ_POLICY_ROUNDROBIN_DURATION 100
 
-/* Default burst count before anoter mirror is selected */
-#define BTRFS_DEFAULT_READ_POLICY_RR_BURST     50
-
 struct btrfs_fs_devices {
        u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
        u8 metadata_uuid[BTRFS_FSID_SIZE];
@@ -327,8 +319,6 @@ struct btrfs_fs_devices {
        u32 read_policy_load_rotating_inc;
        /* Configuration specific for the roundrobin read policy */
        u32 read_policy_roundrobin_duration;
-       /* Configurable burst count for read policy burst */
-       u32 read_policy_burst;
 };
 
 #define BTRFS_BIO_INLINE_CSUM_SIZE     64