DELETE support in the VOP_STRATEGY(9)?

Dag-Erling Smørgrav des at des.no
Tue Dec 8 19:29:07 UTC 2015


Warner Losh <imp at bsdimp.com> writes:
> Dag-Erling Smørgrav <des at des.no> writes:
> > The filesystem can ask the layer below if BIO_DELETE is supported, but
> > should not assume anything about what it means.  For instance, I could
> > write a gnop-like module that translates BIO_DELETE into an all-zeroes
> > BIO_WRITE and passes everything else unmodified.  It would provide a
> > stronger guarantee than, say, SATA TRIM but would also have a completely
> > different performance profile (even on SSDs, since it would do its work
> > synchronously whereas TRIM works asynchronously).
> That ship has sailed. UFS, at least, assumes that if TRIM is supported
> then relocating files to be contiguous is bad.  But writing a gnop
> module that did the BIO_DELETE thing would be bogus.

No less bogus than any other implementation of BIO_DELETE.  I could
write a gnop-like module that silently discards them.  My point is that
it's wrong to infer anything else from GEOM::candelete support than the
fact that BIO_DELETE requests will be accepted and may or may not do
something, somewhere, at some point.  We can easily create a different
GEOM attribute which indicates that seeks are essentially free, and FFS
could use that instead of GEOM::candelete to disable relocation.

> BIO_DELETE does not mean that blocks will read back as zeros.

It doesn't mean they won't, either.

> So, sure you could invent a stupid thing that breaks the rules, and
> thus the assumptions of the other code, but why would you want to do
> that?

It wouldn't break any rules or valid assumptions.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-hackers mailing list