dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 00/13] Block cleanups
@ 2012-08-22 17:03 Kent Overstreet
  2012-08-22 17:03 ` [PATCH v6 01/13] block: Generalized bio pool freeing Kent Overstreet
                   ` (9 more replies)
  0 siblings, 10 replies; 53+ messages in thread
From: Kent Overstreet @ 2012-08-22 17:03 UTC (permalink / raw)
  To: linux-bcache-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dm-devel-H+wXaHxf7aLQT0dZR+AlfA
  Cc: Kent Overstreet, tj-DgEjT+Ai2ygdnm+yROfE0A,
	vgoyal-H+wXaHxf7aLQT0dZR+AlfA, mpatocka-H+wXaHxf7aLQT0dZR+AlfA,
	bharrosh-C4P08NqkoRlBDgjK7y7TUQ

Buncha changes in this version.

I came up with a new, much better solution to the "bio allocation from
bio sets under generic_make_request()" problem. Previously, I was
working around this in all of my code that allocated bios; it'd mask out
GFP_WAIT if current->bio_list != NULL, then punt to workqueue if the
allocation failed - so as to avoid the deadlock from allocating multiple
bios from the same bio set.

This approach worked, but it required it to be explicitly handled in any
stacking driver that might split a bio an arbitrary number of times -
less than ideal.

My new patch inverts this - when we go to allocate a bio and we're
blocking another bio from being submitted, we punt the bio(s) that are
being blocked off to a workqueue to be submitted. This means we only
have to handle it in one place, in bio_alloc_bioset() - stack block
drivers no longer have to do anything special (I got to delete some code
from bcache, and dm wasn't handling this at all before).

Other big change - I consolidated bio allocation. Now bio_alloc(),
bio_kmalloc(), bio_clone(), and bio_clone_kmalloc() are all one line
wrappers.

Incorporated a bunch of review feedback, most of which I hopefully
remembered to note in the patch descriptions this time.

Kent Overstreet (13):
  block: Generalized bio pool freeing
  dm: Use bioset's front_pad for dm_rq_clone_bio_info
  block: Add bio_reset()
  pktcdvd: Switch to bio_kmalloc()
  block: Kill bi_destructor
  block: Consolidate bio_alloc_bioset(), bio_kmalloc()
  block: Avoid deadlocks with bio allocation by stacking drivers
  block: Add an explicit bio flag for bios that own their bvec
  block: Rename bio_split() -> bio_pair_split()
  block: Introduce new bio_split()
  block: Rework bio_pair_split()
  block: Add bio_clone_bioset(), bio_clone_kmalloc()
  block: Only clone bio vecs that are in use

 Documentation/block/biodoc.txt      |   5 -
 block/blk-core.c                    |  10 +-
 drivers/block/drbd/drbd_main.c      |  13 +-
 drivers/block/drbd/drbd_req.c       |  18 +-
 drivers/block/osdblk.c              |   3 +-
 drivers/block/pktcdvd.c             |  73 ++-----
 drivers/block/rbd.c                 |   8 +-
 drivers/md/dm-crypt.c               |   9 -
 drivers/md/dm-io.c                  |  11 -
 drivers/md/dm.c                     |  68 ++----
 drivers/md/linear.c                 |   6 +-
 drivers/md/md.c                     |  44 +---
 drivers/md/raid0.c                  |   8 +-
 drivers/md/raid10.c                 |  23 +-
 drivers/target/target_core_iblock.c |   9 -
 fs/bio-integrity.c                  |  45 ----
 fs/bio.c                            | 419 +++++++++++++++++++++++-------------
 fs/exofs/ore.c                      |   5 +-
 include/linux/bio.h                 | 155 +++++++------
 include/linux/blk_types.h           |  16 +-
 20 files changed, 434 insertions(+), 514 deletions(-)

-- 
1.7.12

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2012-09-03 16:15 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22 17:03 [PATCH v6 00/13] Block cleanups Kent Overstreet
2012-08-22 17:03 ` [PATCH v6 01/13] block: Generalized bio pool freeing Kent Overstreet
     [not found]   ` <1345655050-28199-2-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 21:27     ` Nicholas A. Bellinger
2012-08-22 17:03 ` [PATCH v6 02/13] dm: Use bioset's front_pad for dm_rq_clone_bio_info Kent Overstreet
     [not found]   ` <1345655050-28199-3-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 18:32     ` Tejun Heo
2012-08-22 21:30     ` Vivek Goyal
     [not found]       ` <20120822213010.GA8020-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-24  7:14         ` Kent Overstreet
     [not found]           ` <20120824071448.GF11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 18:40             ` Vivek Goyal
2012-08-22 17:04 ` [PATCH v6 03/13] block: Add bio_reset() Kent Overstreet
     [not found]   ` <1345655050-28199-4-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 18:34     ` Tejun Heo
2012-08-22 19:51       ` Tejun Heo
2012-08-22 17:04 ` [PATCH v6 04/13] pktcdvd: Switch to bio_kmalloc() Kent Overstreet
     [not found]   ` <1345655050-28199-5-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 19:55     ` Tejun Heo
     [not found]       ` <20120822195546.GG19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-28 23:19         ` Jiri Kosina
2012-08-29  4:35           ` Peter Osterlund
2012-09-03 16:15         ` Jiri Kosina
2012-08-22 17:04 ` [PATCH v6 05/13] block: Kill bi_destructor Kent Overstreet
     [not found]   ` <1345655050-28199-6-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:00     ` Tejun Heo
     [not found]       ` <20120822200032.GH19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  5:09         ` Kent Overstreet
2012-08-22 17:04 ` [PATCH v6 06/13] block: Consolidate bio_alloc_bioset(), bio_kmalloc() Kent Overstreet
     [not found]   ` <1345655050-28199-7-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:17     ` Tejun Heo
     [not found]       ` <20120822201730.GI19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  5:04         ` Kent Overstreet
     [not found]           ` <20120824050400.GA11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:08             ` Tejun Heo
2012-08-22 17:04 ` [PATCH v6 07/13] block: Avoid deadlocks with bio allocation by stacking drivers Kent Overstreet
2012-08-22 20:30   ` Tejun Heo
2012-08-24  5:55     ` Kent Overstreet
     [not found]       ` <20120824055554.GC11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:28         ` Tejun Heo
2012-08-22 17:04 ` [PATCH v6 11/13] block: Rework bio_pair_split() Kent Overstreet
     [not found]   ` <1345655050-28199-12-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 21:04     ` Tejun Heo
     [not found]       ` <20120822210410.GL19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  2:25         ` Martin K. Petersen
     [not found]           ` <yq1y5l5hvpw.fsf-+q57XtR/GgMb6DWv4sQWN6xOck334EZe@public.gmane.org>
2012-08-24 10:37             ` Kent Overstreet
2012-08-24 20:58             ` Tejun Heo
2012-08-24 10:30       ` Kent Overstreet
2012-08-24 20:53         ` Tejun Heo
     [not found] ` <1345655050-28199-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 17:04   ` [PATCH v6 08/13] block: Add an explicit bio flag for bios that own their bvec Kent Overstreet
     [not found]     ` <1345655050-28199-9-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 17:43       ` Adrian Bunk
     [not found]         ` <20120822174351.GA27453-c9qLp6CXzmZPEsXTsnYjsA@public.gmane.org>
2012-08-22 19:22           ` Kent Overstreet
2012-08-22 20:00             ` Adrian Bunk
     [not found]               ` <20120822200038.GB27453-c9qLp6CXzmZPEsXTsnYjsA@public.gmane.org>
2012-08-28 17:23                 ` Kent Overstreet
2012-08-22 17:04   ` [PATCH v6 09/13] block: Rename bio_split() -> bio_pair_split() Kent Overstreet
2012-08-22 17:04   ` [PATCH v6 10/13] block: Introduce new bio_split() Kent Overstreet
     [not found]     ` <1345655050-28199-11-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:46       ` Tejun Heo
2012-08-22 17:04   ` [PATCH v6 12/13] block: Add bio_clone_bioset(), bio_clone_kmalloc() Kent Overstreet
     [not found]     ` <1345655050-28199-13-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 17:13       ` Jeff Garzik
2012-08-22 21:07       ` Tejun Heo
     [not found]         ` <20120822210740.GM19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  6:24           ` Kent Overstreet
     [not found]             ` <20120824062418.GD11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:36               ` Tejun Heo
2012-08-23 18:00   ` [PATCH v6 00/13] Block cleanups Vivek Goyal
     [not found]     ` <20120823180041.GK12232-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-24 12:46       ` Kent Overstreet
2012-08-22 17:04 ` [PATCH v6 13/13] block: Only clone bio vecs that are in use Kent Overstreet
     [not found]   ` <1345655050-28199-14-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 21:10     ` Tejun Heo
     [not found]       ` <20120822211045.GN19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  7:05         ` Kent Overstreet
     [not found]           ` <20120824070508.GE11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:42             ` Tejun Heo

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).