Re: blk: improve order of bio handling in generic_make_request()
From: NeilBrown
Date: Thu Mar 09 2017 - 01:08:30 EST
On Wed, Mar 08 2017, Mikulas Patocka wrote:
> On Wed, 8 Mar 2017, NeilBrown wrote:
>>
>> I don't think this will fix the DM snapshot deadlock by itself.
>> Rather, it make it possible for some internal changes to DM to fix it.
>> The DM change might be something vaguely like:
>>
>> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
>> index 3086da5664f3..06ee0960e415 100644
>> --- a/drivers/md/dm.c
>> +++ b/drivers/md/dm.c
>> @@ -1216,6 +1216,14 @@ static int __split_and_process_non_flush(struct clone_info *ci)
>>
>> len = min_t(sector_t, max_io_len(ci->sector, ti), ci->sector_count);
>>
>> + if (len < ci->sector_count) {
>> + struct bio *split = bio_split(bio, len, GFP_NOIO, fs_bio_set);
>
> fs_bio_set is a shared bio set, so it is prone to deadlocks. For this
> change, we would need two bio sets per dm device, one for the split bio
> and one for the outgoing bio. (this also means having one more kernel
> thread per dm device)
Yes, two local bio_sets would be best.
But we don't really need those extra kernel threads. I'll start working
on patches to make them optional, and then to start removing them.
Thanks,
NeilBrown
Attachment:
signature.asc
Description: PGP signature