Skip to content

Commit 6f94268

Browse files
make priority class support conditional
1 parent fa481d1 commit 6f94268

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

lib/blob/blobstore.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -3915,7 +3915,7 @@ bs_alloc(struct spdk_bs_dev *dev, struct spdk_bs_opts *opts, struct spdk_blob_st
39153915
bs->md_thread = spdk_get_thread();
39163916
assert(bs->md_thread != NULL);
39173917

3918-
bs->priority_class = MAX_PRIORITY_CLASS; // max priority for metadata I/O
3918+
bs->priority_class = 0;
39193919

39203920
/*
39213921
* Do not use bs_lba_to_cluster() here since blockcnt may not be an
@@ -10302,6 +10302,7 @@ void
1030210302
spdk_blob_set_priority_class(struct spdk_blob* blob, int priority_class)
1030310303
{
1030410304
blob->priority_class = priority_class;
10305+
if (priority_class) { blob->bs->priority_class = MAX_PRIORITY_CLASS; } // max priority for metadata I/O if priority is supported
1030510306
}
1030610307

1030710308
SPDK_LOG_REGISTER_COMPONENT(blob)

module/bdev/raid/bdev_raid.c

+3
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ raid_bdev_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_i
922922
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, bdev_io->u.bdev.md_buf,
923923
bdev_io->u.bdev.memory_domain, bdev_io->u.bdev.memory_domain_ctx);
924924
raid_io->priority_class = (bdev_io->u.bdev.offset_blocks & PRIORITY_CLASS_MASK) >> PRIORITY_CLASS_BITS_POS;
925+
if (raid_io->priority_class) { raid_io->raid_bdev->supports_priority_class = 1; }
925926

926927
switch (bdev_io->type) {
927928
case SPDK_BDEV_IO_TYPE_READ:
@@ -1539,6 +1540,8 @@ _raid_bdev_create(const char *name, uint32_t strip_size, uint8_t num_base_bdevs,
15391540
base_info->raid_bdev = raid_bdev;
15401541
}
15411542

1543+
raid_bdev->supports_priority_class = 0;
1544+
15421545
/* strip_size_kb is from the rpc param. strip_size is in blocks and used
15431546
* internally and set later.
15441547
*/

module/bdev/raid/bdev_raid.h

+2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ struct raid_bdev {
195195
/* array of base bdev info */
196196
struct raid_base_bdev_info *base_bdev_info;
197197

198+
uint8_t supports_priority_class; // whether lvol priority is supported, default 0 (false)
199+
198200
/* strip size of raid bdev in blocks */
199201
uint32_t strip_size;
200202

module/bdev/raid/raid1.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ raid1_submit_process_request(struct raid_bdev_process_request *process_req,
489489
process_req->offset_blocks, process_req->num_blocks,
490490
&process_req->iov, 1, process_req->md_buf, NULL, NULL);
491491
raid_io->completion_cb = raid1_process_read_completed;
492-
raid_io->priority_class = MAX_PRIORITY_CLASS;
492+
raid_io->priority_class = raid_io->raid_bdev->supports_priority_class ? MAX_PRIORITY_CLASS : 0;
493493

494494
ret = raid1_submit_read_request(raid_io);
495495
if (spdk_likely(ret == 0)) {

module/bdev/raid/raid5f.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ raid5f_submit_process_request(struct raid_bdev_process_request *process_req,
12231223
raid_bdev_io_init(raid_io, raid_ch, SPDK_BDEV_IO_TYPE_READ,
12241224
process_req->offset_blocks, raid_bdev->strip_size,
12251225
&process_req->iov, 1, process_req->md_buf, NULL, NULL);
1226-
raid_io->priority_class = MAX_PRIORITY_CLASS;
1226+
raid_io->priority_class = raid_io->raid_bdev->supports_priority_class ? MAX_PRIORITY_CLASS : 0;
12271227

12281228
ret = raid5f_submit_reconstruct_read(raid_io, stripe_index, chunk_idx, 0,
12291229
raid5f_process_stripe_request_reconstruct_xor_done);

0 commit comments

Comments
 (0)