Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbdCFEkr (ORCPT ); Sun, 5 Mar 2017 23:40:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:51548 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752706AbdCFEkT (ORCPT ); Sun, 5 Mar 2017 23:40:19 -0500 From: NeilBrown To: Jack Wang , Jens Axboe Date: Mon, 06 Mar 2017 15:40:07 +1100 Cc: LKML , Lars Ellenberg , Kent Overstreet , Pavel Machek , Mike Snitzer , Mikulas Patocka Subject: Re: [PATCH] blk: improve order of bio handling in generic_make_request() In-Reply-To: <71562c2c-97f4-9a0a-32ec-30e0702ca575@profitbricks.com> References: <87h93blz6g.fsf@notabene.neil.brown.name> <71562c2c-97f4-9a0a-32ec-30e0702ca575@profitbricks.com> Message-ID: <87lgsjj9w8.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: 2818 Lines: 88 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, Mar 03 2017, Jack Wang wrote: > > Thanks Neil for pushing the fix. > > We can optimize generic_make_request a little bit: > - assign bio_list struct hold directly instead init and merge > - remove duplicate code > > I think better to squash into your fix. Hi Jack, I don't object to your changes, but I'd like to see a response from Jens first. My preference would be to get the original patch in, then other changes that build on it, such as this one, can be added. Until the core changes lands, any other work is pointless. Of course if Jens wants a this merged before he'll apply it, I'll happily do that. Thanks, NeilBrown > --- > block/blk-core.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 3bc7202..b29b7e5 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -2147,8 +2147,7 @@ blk_qc_t generic_make_request(struct bio *bio) > struct bio_list lower, same, hold; >=20=20 > /* Create a fresh bio_list for all subordinate requests */ > - bio_list_init(&hold); > - bio_list_merge(&hold, &bio_list_on_stack); > + hold =3D bio_list_on_stack; > bio_list_init(&bio_list_on_stack); >=20=20 > ret =3D q->make_request_fn(q, bio); > @@ -2168,14 +2167,10 @@ blk_qc_t generic_make_request(struct bio *bio) > bio_list_merge(&bio_list_on_stack, &lower); > bio_list_merge(&bio_list_on_stack, &same); > bio_list_merge(&bio_list_on_stack, &hold); > - > - bio =3D bio_list_pop(current->bio_list); > } else { > - struct bio *bio_next =3D bio_list_pop(current->bio_list); > - > bio_io_error(bio); > - bio =3D bio_next; > } > + bio =3D bio_list_pop(current->bio_list); > } while (bio); > current->bio_list =3D NULL; /* deactivate */ >=20=20 > --=20 > > Regards, > Jack=20 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAli86CgACgkQOeye3VZi gbl68g//fxng6a0tscxiEAjl+4uahouTHwEcabfQ7o5puk1XEf+ZIYUC5pk+MWUa wgExIe662R0mdRK7tg/ERqpXqkRaEWEqFV+fQD9LR3/2J5B49unFa0TAcdjqZnLM +8l1cby32YU6PcPUfSo4q7KjoYvd6bYvvywST5ypnyGu2xbDkju28AJ0D/D4I4ur ic3pjx//qrOvfPPtlktV/AXFLWgEf7tv5eJhfEm2fm+fQyJw+OefTjAWXvM9swCg /XTamYMG/0/7L7R8elTfhO2wfUZN/QHSTMwII9WAq1Fe76veeuyZBonHI3Q96lzl KWjjkplS+AZfcCTo2I1W+9wt+Dp3MLfiPg423wC3ter07d6YGQAbZaTUBgCFCKuW JAI4qTKWcnSgc3+uv4l6NRZXeQBferXRKmVfgcKyVFsd6Rpk9Kru9LsWOaKxFg+p 8a6XQ1N82PPWy/2z4V04yRzdGOFA1DNP1MAD3HciDk+93TRVCWrV1ytCglCnSg8e f3i0PANGh6nGZjDOiekmLuyy66XJ3Vot6auvB4LkjZHWcR773TpnwEMeMqV2txkB 0rBiFAzzfU2eRiAEekbxgGqbtuwLSdm9ISHmWyX7TADvV0o2te7qLxeUV/zSyQTb AQNHL2CNlqAQf481g2a5r0fMwcIQxVf7TjYWz9XqK0JTNTJksGY= =zFi1 -----END PGP SIGNATURE----- --=-=-=--