Commit 3790a412 authored by Sochin Jiang's avatar Sochin Jiang Committed by Tomasz Zawadzki
Browse files

lib/blob: try best to merge the contiguous clusters



blob_persist_clear_clusters() issues 'unmap' or 'write_zeroes'
IOs in one batch, this can consumes lots of 'bdev_io's.
we need to try best to merge the contiguous clusters
especially in the following case:

cluster 0: LBA 128 (count = 128)
cluster 1: LBA 0 (meaning thin provisioned, no cluster allocated)
cluster 2: LBA 256 (count = 128)

Besides, in the long run, we may need to do this batch by sequence.

Signed-off-by: default avatarSochin Jiang <jiangxiaoqing.sochin@bytedance.com>
Change-Id: I436c8b46a1ee33ec127d0f43fd85b2c443689b59
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4082


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 18274baf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1732,6 +1732,8 @@ blob_persist_clear_clusters(spdk_bs_sequence_t *seq, struct spdk_blob_persist_ct
			/* This cluster is contiguous with the previous one. */
			lba_count += next_lba_count;
			continue;
		} else if (next_lba == 0) {
			continue;
		}

		/* This cluster is not contiguous with the previous one. */