aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-bio-prison.h
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-10-06 16:30:06 -0400
committerMike Snitzer <snitzer@redhat.com>2014-11-10 15:25:26 -0500
commita195db2d29a47c2c3a61386009bd400df18c86cf (patch)
tree17f9c41a52fa28c6a03840a0df24a3781c280217 /drivers/md/dm-bio-prison.h
parent33096a7822de63bc7dbdd090870b656a0304fa35 (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.h7
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 */
37struct dm_bio_prison_cell { 37struct 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
44struct dm_bio_prison *dm_bio_prison_create(unsigned nr_cells); 45struct dm_bio_prison *dm_bio_prison_create(void);
45void dm_bio_prison_destroy(struct dm_bio_prison *prison); 46void dm_bio_prison_destroy(struct dm_bio_prison *prison);
46 47
47/* 48/*