From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751905AbdH2WQ0 (ORCPT ); Tue, 29 Aug 2017 18:16:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:49814 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751859AbdH2WQZ (ORCPT ); Tue, 29 Aug 2017 18:16:25 -0400 From: NeilBrown To: Philipp Reisner , Lars Ellenberg Date: Wed, 30 Aug 2017 08:16:15 +1000 Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org Subject: [PATCH] drbd: remove BIOSET_NEED_RESCUER flag from drbd_{md_,}io_bio_set Message-ID: <87bmmygguo.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-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 =2D-- drivers/block/drbd/drbd_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index e2ed28d45ce1..4fe7c058a573 100644 =2D-- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2167,13 +2167,12 @@ static int drbd_create_mempools(void) goto Enomem; =20 /* mempools */ =2D drbd_io_bio_set =3D bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_RESCUER= ); + drbd_io_bio_set =3D bioset_create(BIO_POOL_SIZE, 0, 0); if (drbd_io_bio_set =3D=3D NULL) goto Enomem; =20 drbd_md_io_bio_set =3D bioset_create(DRBD_MIN_POOL_PAGES, 0, =2D BIOSET_NEED_BVECS | =2D BIOSET_NEED_RESCUER); + BIOSET_NEED_BVECS); if (drbd_md_io_bio_set =3D=3D NULL) goto Enomem; =20 =2D-=20 2.14.0.rc0.dirty --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlml57EACgkQOeye3VZi gbnSig/9F8bo9ud5Aoo5fhkjP/xbHGSiKG7rl3v9cm3JeOEFpBbfeRsyNPxpawI3 4bJnO3fSp/lr3pUajD4n/AzAqTqWwTGU0p2EBa+COKRWORCw8K3Z6jbxHCthVlFr qKgBL5q7vzAxgkdx5euF7lXDcbu9VH4X4+6Cf0kp7ydvoPVp7X5aqHwlZxfIg/6d 3l4UrVduKqRR7pavg0zrMzc4NglGL5dF/xAvjyeyul5m3c9+6oMpvgOkhKXy5J4a nIvnJoCmS735xzzXj6spB3P35MEQ3wJDocYg6Z4VjiN4tHbm5yiJ3viMADR1z2hT z/mrs1Ggvn69qX/FJcolji3wGMzB3j2EVfouQHGTQJqQdm+sAPAoJoAQv99Xfa8d Zc/+fW7ecBrCA8g7NANIeH9bmr2UFt7W+Ff2UzcTzADWXNUORQKTMC+mQWpCHSVa Ns2iXJX4Z54JkASYuR6tndSvQ/zFx+2WJb54XGNllnaMZrI2An38SWaRd2oLbRRs WRqhzy645A6KzUjrAx3ia1mGH3CS878T0MSyrStN5SFOmsuN4T8DoFfUi6ySK5H7 uvuBSguYFlA9W0ZV6Iai0yc2lKw+/nYqXNOgIUKemAPDbYTwuhcict0JR0fQja+q yXKJGmJ/124w5GuESCa/39VtPup5d0+H0l2HNaqJx8yO8AvEdIk= =e+9f -----END PGP SIGNATURE----- --=-=-=--