BmapCopy: increase the batch queue length
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 24 Sep 2013 07:37:09 +0000 (10:37 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Mon, 30 Sep 2013 07:10:03 +0000 (10:10 +0300)
BmapCopy reads and writes from different threads to exploit parallelizm. There
is a "batch queue" where the reader supply 1MiB buffers and the writer consumes
them. The length of the queue is 6 for block devices and 2 for files. This
patch makes it to be 6 everywhere since 2 is rather short.

Change-Id: Ia4c6293ad2433fd7b466733ff9fbe5a0bd288d13
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/BmapCopy.py

index e22aa7789f0c9e725627f49ef627843a1d45db60..3899f38bedc74e98f8dc447127f3bc65ec44eca8 100644 (file)
@@ -140,7 +140,7 @@ class BmapCopy:
         self._batch_blocks = None
         self._batch_queue = None
         self._batch_bytes = 1024 * 1024
-        self._batch_queue_len = 2
+        self._batch_queue_len = 6
 
         self.bmap_version = None
         self.bmap_version_major = None
@@ -628,9 +628,6 @@ class BmapBdevCopy(BmapCopy):
         # Call the base class constructor first
         BmapCopy.__init__(self, image, dest, bmap, image_size, logger=logger)
 
-        self._batch_bytes = 1024 * 1024
-        self._batch_blocks = self._batch_bytes / self.block_size
-        self._batch_queue_len = 6
         self._dest_fsync_watermark = (6 * 1024 * 1024) / self.block_size
 
         self._sysfs_base = None