summary refs log tree commit diff
path: root/drivers/md/dm-bufio.h
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2014-01-13 19:13:05 -0500
committerMike Snitzer <snitzer@redhat.com>2014-01-14 23:23:03 -0500
commit55b082e614e219fb5199a6f93e648ed35d3c96d5 (patch)
treea2707e62bdd914e9651e78cde6cb55a5f0b88d7f /drivers/md/dm-bufio.h
parent55494bf2947dccdf2d98b62374fea7365dfead84 (diff)
downloadlinux-55b082e614e219fb5199a6f93e648ed35d3c96d5.tar.gz
dm snapshot: use dm-bufio prefetch
This patch modifies dm-snapshot so that it prefetches the buffers when
loading the exceptions.

The number of buffers read ahead is specified in the DM_PREFETCH_CHUNKS
macro.  The current value for DM_PREFETCH_CHUNKS (12) was found to
provide the best performance on a single 15k SCSI spindle.  In the
future we may modify this default or make it configurable.

Also, introduce the function dm_bufio_set_minimum_buffers to setup
bufio's number of internal buffers before freeing happens.  dm-bufio may
hold more buffers if enough memory is available.  There is no guarantee
that the specified number of buffers will be available - if you need a
guarantee, use the argument reserved_buffers for
dm_bufio_client_create.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-bufio.h')
-rw-r--r--drivers/md/dm-bufio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-bufio.h b/drivers/md/dm-bufio.h
index 3dac37627ba4..c096779a7292 100644
--- a/drivers/md/dm-bufio.h
+++ b/drivers/md/dm-bufio.h
@@ -115,6 +115,11 @@ void dm_bufio_release_move(struct dm_buffer *b, sector_t new_block);
  */
 void dm_bufio_forget(struct dm_bufio_client *c, sector_t block);
 
+/*
+ * Set the minimum number of buffers before cleanup happens.
+ */
+void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n);
+
 unsigned dm_bufio_get_block_size(struct dm_bufio_client *c);
 sector_t dm_bufio_get_device_size(struct dm_bufio_client *c);
 sector_t dm_bufio_get_block_number(struct dm_buffer *b);