Skip to contentSkip to conversation

ublk vs write cache and FUA

DISCUSSION Christoph Hellwig 2 participants 3 messages Jul 21, 2022 – Jul 22, 2022 Block layer

lore
Share & tools
lore
#0 lore raw

Hi Ming,

ublk implements REQ_OP_FLUSH and REQ_FUA, but will never see those as it never calls blk_queue_write_cache. Can we drop the code? Or should there be a flag to enable write cache and fua support when setting up a device?

#1 lore raw
Quoted 6 lines · Christoph Hellwig

Hi Ming,

ublk implements REQ_OP_FLUSH and REQ_FUA, but will never see those as it never calls blk_queue_write_cache. Can we drop the code? Or should there be a flag to enable write cache and fua support when setting up a device?

There should have been flags defined in ublksrv_ctrl_dev_info for describe wc/fua info, since ublk_drv doesn't handle any device specific logic.

So please keep REQ_OP_FLUSH and REQ_FUA which two should be useful, and I will add flags and related code to use them.

Thanks,
Ming

#2 lore raw
Quoted 8 lines · Ming Lei
Quoted 6 lines · Christoph Hellwig

Hi Ming,

ublk implements REQ_OP_FLUSH and REQ_FUA, but will never see those as it never calls blk_queue_write_cache. Can we drop the code? Or should there be a flag to enable write cache and fua support when setting up a device?

Quoted 5 lines

There should have been flags defined in ublksrv_ctrl_dev_info for describe wc/fua info, since ublk_drv doesn't handle any device specific logic.

So please keep REQ_OP_FLUSH and REQ_FUA which two should be useful, and I will add flags and related code to use them.

Actually we can add two commands for set/get device parameter, then at least generic block device parameters(wc, fua, discard, zoned, rototional, ...) can be configurable, so all kinds of block device can be simulated with userspace ublk.

Thanks,
Ming