On 03/29/2018 10:52 AM, Wouter Verhelst wrote:
On Wed, Mar 28, 2018 at 02:35:02PM -0500, Eric Blake wrote:We may also want to consider an extension where a server can advertise whether a successful TRIM guarantees a reads-as-zero effect (this behavior is not required of a generic server, but may be useful to exploit when a client knows that a specific server supports it).Isn't that why we specified WRITE_ZEROES in a way that it could optionally also have the effect that TRIM was meant for?
Indeed, we specified WRITE_ZEROES to be permitted to take advantage of TRIM semantics unless the user passes a flag that requests explicit allocation rather than punching a hole; although that's also relatively weak (the client can choose whether to avoid a trim, but cannot guarantee a trim, as it is optional whether the server translates a write zeroes into a trim based on guarantees about trim behavior). At any rate, without a specific use case of where KNOWING what trim can do and why it is different from what WRITE_ZEROES is permitted to do, I'm not going to propose an extension at this time.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org