Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbdCIGI2 (ORCPT ); Thu, 9 Mar 2017 01:08:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:56619 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752114AbdCIGI0 (ORCPT ); Thu, 9 Mar 2017 01:08:26 -0500 From: NeilBrown To: Mikulas Patocka Date: Thu, 09 Mar 2017 17:08:16 +1100 Cc: Mike Snitzer , Jens Axboe , Jack Wang , LKML , Lars Ellenberg , Kent Overstreet , Pavel Machek Subject: Re: blk: improve order of bio handling in generic_make_request() In-Reply-To: References: <87h93blz6g.fsf@notabene.neil.brown.name> <71562c2c-97f4-9a0a-32ec-30e0702ca575@profitbricks.com> <87lgsjj9w8.fsf@notabene.neil.brown.name> <20170307165233.GB30230@redhat.com> <5cfbdc6b-9ba7-605a-642b-7f625cf5f5b7@kernel.dk> <20170307171436.GA2109@redhat.com> <87tw74j0e4.fsf@notabene.neil.brown.name> Message-ID: <87shmngey7.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2161 Lines: 56 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, Mar 08 2017, Mikulas Patocka wrote: > On Wed, 8 Mar 2017, NeilBrown wrote: >>=20 >> 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: >>=20 >> 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 c= lone_info *ci) >>=20 >> len =3D min_t(sector_t, max_io_len(ci->sector, ti), ci->sector_count); >>=20 >> + if (len < ci->sector_count) { >> + struct bio *split =3D 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=20 > change, we would need two bio sets per dm device, one for the split bio=20 > and one for the outgoing bio. (this also means having one more kernel=20 > 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAljA8VAACgkQOeye3VZi gbn/zQ/+KAqeR6PpeczpfGDjdQO/05Dc6sgWZVUxzft73oYgW2II1Gc82oxMq+Tm GiN9n3IblIcvEfUpeQOOQeKCvtvohS9a2LUxcL6agR+ocsSlnkXl9LOiGbfiLdiY xmXwYQBUeL1ZjmbPfw3MUTAlFKQS3lxVBKEVfuDGRDctT/N/I5fBthhWVzmTke3G 4MdIUVVKlQqXOScnzYi1Nca/1DfBJ0bAX8MV7qN8OOq8qiA0UGkMPGe+wvE2FpKb J/Gcv6gHb6OQtjTm/imh4ftbT4cfP2DuHoHNWlskb+fmJ1uGSIkp7cl//+KNhSPf 7+NJzGQnFfh76GwnaLPJT+aHQRcqW+hZ+X2O3QwxXc9R9nXxOeIVG8HZfZ0L/ieS 4ZzKF6yjfIa0asC1nK61bfoMWpDoUbywps1Ze7EzJDZ+y82zrAzI6oFEvm/mjda4 gDgzY0uvYMRbaq4kCMXV9DgKlbskKO/+bfurKfEWNFXyCrVoUWLtmcAbDuHQK9CV fU1v2Kb45otttx1h9ORnEtEV4ty8BJqT7JN1ig89X83N0elm6+6r0WoomRH0Q+XY qT4iKYf6XA/htV+/zq8l0Jt5KhueMN3l1MXpMXFlly9xSY2zCDsWECOWl2zqVJiN dNhciisSG0WWk7j5SkJZd/kaFf8q18ukO0yrpSAGjIJd91sCAyo= =0jXD -----END PGP SIGNATURE----- --=-=-=--