Re: [PATCH 03/13] blk: make the bioset rescue_workqueue optional.

NeilBrown
2017-05-02T22:10:29Z

[-- Attachment #1: Type: text/plain, Size: 2139 bytes --]

On Tue, May 02 2017, Ming Lei wrote:

> On Tue, May 02, 2017 at 01:42:24PM +1000, NeilBrown wrote:
>> This patch converts bioset_create() and
>> bioset_create_nobvec() to not create a workqueue so
>> alloctions will never trigger punt_bios_to_rescuer(). It
>> also introduces bioset_create_rescued() and
>> bioset_create_nobvec_rescued() which preserve the old
>> behaviour.
>>
>> All callers of bioset_create() and bioset_create_nobvec(),
>> that are inside block device drivers, are converted to the
>> _rescued() version.
>
> The above comment about *_nobvec() need to be updated.

Yes - thanks. I'll post an updated version.

>
>>
>> biosets used by filesystems or other top-level users do not
>> need rescuing as the bio can never be queued behind other
>> bios. This includes fs_bio_set, blkdev_dio_pool,
>> btrfs_bioset, xfs_ioend_bioset, drbd_md_io_bio_set,
>> and one allocated by target_core_iblock.c.
>>
>> biosets used by md/raid to not need rescuing as
>> their usage was recently audited to revised to never
>> risk deadlock.
>>
>> It is hoped that most, if not all, of the remaining biosets
>> can end up being the non-rescued version.
>>
>> Signed-off-by: NeilBrown <neilb@suse.com>
>> ---
>> block/bio.c | 12 ++++++++++--
>> block/blk-core.c | 2 +-
>> drivers/md/bcache/super.c | 6 ++++--
>> drivers/md/dm-crypt.c | 2 +-
>> drivers/md/dm-io.c | 2 +-
>> drivers/md/dm.c | 5 +++--
>> include/linux/bio.h | 1 +
>> 7 files changed, 21 insertions(+), 9 deletions(-)
>
> DRBD can stack on block device too, so I guess it might need
> BIOSET_NEED_RESCUER?

A bioset only needs a rescuer is an allocation is made from the bioset
inside a make_request_fn.
The bioset in DRBD is drbd_md_io_bio_set is used for metadata IO, and
I think it is only used in a worker thread, where rescuing cannot help.
But that is probably subtle enough that I should leave the removal
of the rescuer to a subsequent patch.
So I'll give DRBD the flag when I update the changelog comment.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]