diff options
author | Joe Thornber <ejt@redhat.com> | 2014-10-06 16:30:06 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-11-10 15:25:26 -0500 |
commit | a195db2d29a47c2c3a61386009bd400df18c86cf (patch) | |
tree | 17f9c41a52fa28c6a03840a0df24a3781c280217 /drivers/md/dm-bio-prison.h | |
parent | 33096a7822de63bc7dbdd090870b656a0304fa35 (diff) |
dm bio prison: switch to using a red black tree
Previously it was using a fixed sized hash table. There are times
when very many concurrent cells are held (such as when processing a very
large discard). When this happens the hash table performance becomes
very poor.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-bio-prison.h')
-rw-r--r-- | drivers/md/dm-bio-prison.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-bio-prison.h b/drivers/md/dm-bio-prison.h index 6805a142b750..997a43960e77 100644 --- a/drivers/md/dm-bio-prison.h +++ b/drivers/md/dm-bio-prison.h | |||
@@ -10,8 +10,8 @@ | |||
10 | #include "persistent-data/dm-block-manager.h" /* FIXME: for dm_block_t */ | 10 | #include "persistent-data/dm-block-manager.h" /* FIXME: for dm_block_t */ |
11 | #include "dm-thin-metadata.h" /* FIXME: for dm_thin_id */ | 11 | #include "dm-thin-metadata.h" /* FIXME: for dm_thin_id */ |
12 | 12 | ||
13 | #include <linux/list.h> | ||
14 | #include <linux/bio.h> | 13 | #include <linux/bio.h> |
14 | #include <linux/rbtree.h> | ||
15 | 15 | ||
16 | /*----------------------------------------------------------------*/ | 16 | /*----------------------------------------------------------------*/ |
17 | 17 | ||
@@ -35,13 +35,14 @@ struct dm_cell_key { | |||
35 | * themselves. | 35 | * themselves. |
36 | */ | 36 | */ |
37 | struct dm_bio_prison_cell { | 37 | struct dm_bio_prison_cell { |
38 | struct hlist_node list; | 38 | struct rb_node node; |
39 | |||
39 | struct dm_cell_key key; | 40 | struct dm_cell_key key; |
40 | struct bio *holder; | 41 | struct bio *holder; |
41 | struct bio_list bios; | 42 | struct bio_list bios; |
42 | }; | 43 | }; |
43 | 44 | ||
44 | struct dm_bio_prison *dm_bio_prison_create(unsigned nr_cells); | 45 | struct dm_bio_prison *dm_bio_prison_create(void); |
45 | void dm_bio_prison_destroy(struct dm_bio_prison *prison); | 46 | void dm_bio_prison_destroy(struct dm_bio_prison *prison); |
46 | 47 | ||
47 | /* | 48 | /* |