On Fri, Jan 18, 2019 at 3:56 PM Roman Penyaev <rpenyaev@xxxxxxx> wrote: > > Hi all, > > This is an attempt to split DISCARD and WRITE_ZEROES paths on krbd side > when REQ_NOUNMAP flag is set for a block layer request. Hi Roman, I'm working on splitting DISCARD and WRITE_ZEROES handling right now. The idea is to punt on small and/or unaligned discard requests which don't actually free up any space but translate into a RADOS zero op. I'm not changing how WRITE_ZEROES is implemented though, so this is orthogonal to your work -- just wanted to give a heads up. > > Currently both REQ_OP_DISCARD and REQ_OP_WRITE_ZEROES block layer requests > fall down to CEPH_OSD_OP_ZERO request, which punches holes on osd side. > > With a new CEPH_OSD_OP_FLAG_ZERO_NOUNMAP flag for CEPH_OSD_OP_ZERO request > osd can zero out blocks, instead of punching holes. REQ_NOUNMAP is just a hint, the block device is free to ignore it. IIRC the only way to control it from userspace is through fallocate(2): FALLOC_FL_PUNCH_HOLE can unmap, while FALLOC_FL_ZERO_RANGE is supposed to not unmap. Given that fallocate(2) on block devices is fairly new, I'm curious if you have an application that actually cares in mind? Thanks, Ilya