diff options
author | NeilBrown <neilb@suse.com> | 2017-08-30 07:47:12 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-08-30 10:10:02 -0400 |
commit | 974c58566e0b047d785701b6cf788a810072a4c1 (patch) | |
tree | 449f46a687f10defc40ac4bcc14e077d940ae7ae | |
parent | 5fc1efd5de1a1685e68d80981c7676c4d323d93c (diff) |
drbd: remove BIOSET_NEED_RESCUER flag from drbd_{md_,}io_bio_set
Careful analysis shows that this flag is not needed.
The RESCUER flag is only needed when a make_request_fn might:
- allocate a bio from the bioset
- submit it with generic_make_request() or similar
- allocate another bio from the bioset
The second allocation can block until the first bio is processed, so
a rescuer is needed to ensure the first bio does get processed. With
a rescuer it will only get processed when the make_request_fn completes.
In drbd, allocations from drbd_io_bio_set happen from drbd_new_req()
or w_restart_disk_io() which is only called to handle
RESTART_FROZEN_DISK_IO.
In former is called precisely once from the make_request_fn.
The later is never called by within the make_request_fn.
So there cannot be two allocations in the same call to the
make_request_fn, so a rescuer is not needed.
Allocations from drbd_md_io_bio_set are used for IO to the bitmap and
the activity log. There are only accessed from worker threads and
workqueues, never directly from make_request_fn.
Again, the rescuer isn't needed.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 92ba4c08835c..8cb3791898ae 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2178,13 +2178,12 @@ static int drbd_create_mempools(void) | |||
2178 | goto Enomem; | 2178 | goto Enomem; |
2179 | 2179 | ||
2180 | /* mempools */ | 2180 | /* mempools */ |
2181 | drbd_io_bio_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_RESCUER); | 2181 | drbd_io_bio_set = bioset_create(BIO_POOL_SIZE, 0, 0); |
2182 | if (drbd_io_bio_set == NULL) | 2182 | if (drbd_io_bio_set == NULL) |
2183 | goto Enomem; | 2183 | goto Enomem; |
2184 | 2184 | ||
2185 | drbd_md_io_bio_set = bioset_create(DRBD_MIN_POOL_PAGES, 0, | 2185 | drbd_md_io_bio_set = bioset_create(DRBD_MIN_POOL_PAGES, 0, |
2186 | BIOSET_NEED_BVECS | | 2186 | BIOSET_NEED_BVECS); |
2187 | BIOSET_NEED_RESCUER); | ||
2188 | if (drbd_md_io_bio_set == NULL) | 2187 | if (drbd_md_io_bio_set == NULL) |
2189 | goto Enomem; | 2188 | goto Enomem; |
2190 | 2189 | ||