linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Mike Snitzer <snitzer@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-raid@vger.kernel.org,
	device-mapper development <dm-devel@redhat.com>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Pavel Machek <pavel@ucw.cz>,
	Jack Wang <jinpu.wang@profitbricks.com>,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	Kent Overstreet <kent.overstreet@gmail.com>
Subject: [PATCH 4/5] blk: use non-rescuing bioset for q->bio_split.
Date: Fri, 10 Mar 2017 17:00:47 +1100	[thread overview]
Message-ID: <148912564749.4002.12977222491155249514.stgit@noble> (raw)
In-Reply-To: <148912539296.4002.219258660543808741.stgit@noble>

A rescuing bioset is only useful if there might be bios from
that same bioset on the bio_list_on_stack queue at a time
when bio_alloc_bioset() is called.  This never applies to
q->bio_split.

Allocations from q->bio_split are only ever made from
blk_queue_split() which is only ever called early in each of
various make_request_fn()s.  The original bio (call this A)
is then passed to generic_make_request() and is placed on
the bio_list_on_stack queue, and the bio that was allocated
from q->bio_split (B) is processed.

The processing of this may cause other bios to be passed to
generic_make_request() or may even cause the bio B itself to
be passed, possible after some prefix has been split off
(using some other bioset).

generic_make_request() now guarantees that all of these bios
(B and dependants) will be fully processed before the tail
of the original bio A gets handled.  None of these early bios
can possible trigger an allocation from the original
q->bio_split as they are either too small to require
splitting or (more likely) are destined for a different queue.

The next time that the original q->bio_split might be used
by this thread is when A is processed again, as it might
still be too big to handle directly.  By this time there
cannot be any other bios allocated from q->bio_split in the
generic_make_request() queue.  So no rescuing will ever be
needed.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 block/blk-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 430c82f646eb..fae7966e1f98 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -712,7 +712,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
 	if (q->id < 0)
 		goto fail_q;
 
-	q->bio_split = bioset_create_rescued(BIO_POOL_SIZE, 0);
+	q->bio_split = bioset_create(BIO_POOL_SIZE, 0);
 	if (!q->bio_split)
 		goto fail_id;
 

  parent reply	other threads:[~2017-03-10  6:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  6:00 [PATCH 0/5] Updates following recent generic_make_request improvement NeilBrown
2017-03-10  6:00 ` [PATCH 5/5] block_dev: make blkdev_dio_pool a non-rescuing bioset NeilBrown
2017-03-10  6:00 ` [PATCH 2/5] blk: remove bio_set arg from blk_queue_split() NeilBrown
2017-03-10  6:00 ` [PATCH 3/5] blk: make the bioset rescue_workqueue optional NeilBrown
2017-03-10  6:00 ` NeilBrown [this message]
2017-03-10  6:00 ` [PATCH 1/5] blk: Ensure users for current->bio_list can see the full list NeilBrown
2017-03-11 22:32 ` [PATCH 0/5] Updates following recent generic_make_request improvement Jens Axboe
2017-03-12 21:52   ` [dm-devel] " NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2017-03-03  5:14 [PATCH] blk: improve order of bio handling in generic_make_request() NeilBrown
2017-03-03  9:28 ` Jack Wang
2017-03-06  4:40   ` NeilBrown
2017-03-06 20:18     ` Jens Axboe
2017-03-07 20:38       ` [PATCH v2] " NeilBrown
2017-03-10  4:32         ` NeilBrown
2017-03-10  4:36           ` [PATCH 4/5] blk: use non-rescuing bioset for q->bio_split NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148912564749.4002.12977222491155249514.stgit@noble \
    --to=neilb@suse.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=jinpu.wang@profitbricks.com \
    --cc=kent.overstreet@gmail.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).