]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
md: drop queue limitation for RAID1 and RAID10
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Fri, 17 Dec 2021 09:29:55 +0000 (10:29 +0100)
committerSong Liu <song@kernel.org>
Thu, 6 Jan 2022 16:37:02 +0000 (08:37 -0800)
As suggested by Neil Brown[1], this limitation seems to be
deprecated.

With plugging in use, writes are processed behind the raid thread
and conf->pending_count is not increased. This limitation occurs only
if caller doesn't use plugs.

It can be avoided and often it is (with plugging). There are no reports
that queue is growing to enormous size so remove queue limitation for
non-plugged IOs too.

[1] https://lore.kernel.org/linux-raid/162496301481.7211.18031090130574610495@noble.neil.brown.name

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/raid1-10.c
drivers/md/raid1.c
drivers/md/raid10.c

index 54db341639687e47b5d32c5d9bc08e1d2e761840..83f9a4f3d82e01631de00d87bdff6af0dbf8adab 100644 (file)
 
 #define BIO_SPECIAL(bio) ((unsigned long)bio <= 2)
 
-/* When there are this many requests queue to be written by
- * the raid thread, we become 'congested' to provide back-pressure
- * for writeback.
- */
-static int max_queued_requests = 1024;
-
 /* for managing resync I/O pages */
 struct resync_pages {
        void            *raid_bio;
index 7dc8026cf6ee04077980056357447d2b710ee440..eeaedd6e0ce184cb68d54fc695b5963ef82df93a 100644 (file)
@@ -1358,12 +1358,6 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
        r1_bio = alloc_r1bio(mddev, bio);
        r1_bio->sectors = max_write_sectors;
 
-       if (conf->pending_count >= max_queued_requests) {
-               md_wakeup_thread(mddev->thread);
-               raid1_log(mddev, "wait queued");
-               wait_event(conf->wait_barrier,
-                          conf->pending_count < max_queued_requests);
-       }
        /* first select target devices under rcu_lock and
         * inc refcount on their rdev.  Record them by setting
         * bios[x] to bio
@@ -3410,4 +3404,3 @@ MODULE_ALIAS("md-personality-3"); /* RAID1 */
 MODULE_ALIAS("md-raid1");
 MODULE_ALIAS("md-level-1");
 
-module_param(max_queued_requests, int, S_IRUGO|S_IWUSR);
index dde98f65bd04f2c2977864b72cb3bd17292b5a05..c683ba138b5873c24670fe9e96383823ce716ad7 100644 (file)
@@ -1387,12 +1387,6 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,
                conf->reshape_safe = mddev->reshape_position;
        }
 
-       if (conf->pending_count >= max_queued_requests) {
-               md_wakeup_thread(mddev->thread);
-               raid10_log(mddev, "wait queued");
-               wait_event(conf->wait_barrier,
-                          conf->pending_count < max_queued_requests);
-       }
        /* first select target devices under rcu_lock and
         * inc refcount on their rdev.  Record them by setting
         * bios[x] to bio
@@ -5243,4 +5237,3 @@ MODULE_ALIAS("md-personality-9"); /* RAID10 */
 MODULE_ALIAS("md-raid10");
 MODULE_ALIAS("md-level-10");
 
-module_param(max_queued_requests, int, S_IRUGO|S_IWUSR);