On Mon, Aug 1, 2016 at 7:55 PM, Alex Gorbachev <ag@xxxxxxxxxxxxxxxxxxx> wrote: > RBD illustration showing RBD ignoring discard until a certain > threshold - why is that? This behavior is unfortunately incompatible > with ESXi discard (UNMAP) behavior. > > Is there a way to lower the discard sensitivity on RBD devices? > > > > root@e1:/var/log# rbd diff spin1/testdis|awk '{ SUM += $2 } END { > print SUM/1024 " KB" }' > 819200 KB > > root@e1:/var/log# blkdiscard -o 0 -l 4096 /dev/rbd28 > root@e1:/var/log# rbd diff spin1/testdis|awk '{ SUM += $2 } END { > print SUM/1024 " KB" }' > 819200 KB > > root@e1:/var/log# blkdiscard -o 0 -l 40960 /dev/rbd28 > root@e1:/var/log# rbd diff spin1/testdis|awk '{ SUM += $2 } END { > print SUM/1024 " KB" }' > 819200 KB > > root@e1:/var/log# blkdiscard -o 0 -l 409600 /dev/rbd28 > root@e1:/var/log# rbd diff spin1/testdis|awk '{ SUM += $2 } END { > print SUM/1024 " KB" }' > 819200 KB > > root@e1:/var/log# blkdiscard -o 0 -l 4096000 /dev/rbd28 > root@e1:/var/log# rbd diff spin1/testdis|awk '{ SUM += $2 } END { > print SUM/1024 " KB" }' > 819200 KB > > root@e1:/var/log# blkdiscard -o 0 -l 40960000 /dev/rbd28 > root@e1:/var/log# rbd diff spin1/testdis|awk '{ SUM += $2 } END { > print SUM/1024 " KB" }' > 782336 KB Think about it in terms of underlying RADOS objects (4M by default). There are three cases: discard range | command ----------------------------------------- whole object | delete object's tail | truncate object's head | zero Obviously, only delete and truncate free up space. In all of your examples, except the last one, you are attempting to discard the head of the (first) object. You can free up as little as a sector, as long as it's the tail: Offset Length Type 0 4194304 data # blkdiscard -o $(((4 << 20) - 512)) -l 512 /dev/rbd28 Offset Length Type 0 4193792 data Thanks, Ilya _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com