Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 2015 12:19:11 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Dag-Erling Sm??rgrav <des@des.no>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: DELETE support in the VOP_STRATEGY(9)?
Message-ID:  <0A599E1F-FF63-4F21-B765-44A4531968DB@bsdimp.com>
In-Reply-To: <20151208190622.GE82577@kib.kiev.ua>
References:  <CAH7qZfs6ksE%2BQTMFFLYxY0PNE4hzn=D5skzQ91=gGK2xvndkfw@mail.gmail.com> <86poyhqsdh.fsf@desk.des.no> <CAH7qZftVj9m_yob=AbAQA7fh8yG-VLgM7H0skW3eX_S%2Bv75E-g@mail.gmail.com> <86fuzdqjwn.fsf@desk.des.no> <CANCZdfo=NfKy51%2B64-F_v%2BDh2wkrFYP4gXe=X9RWSSao49gO9g@mail.gmail.com> <CANCZdfqHoduhdCss0b6=UsBPAxfRZv4hF8vyuUVLBdP5gYUduQ@mail.gmail.com> <864mfssxgt.fsf@desk.des.no> <CANCZdfoXdcD%2B9jeVR1Np16gafBf0_4B2wombwxze8DvJwf7cMg@mail.gmail.com> <86wpsord9l.fsf@desk.des.no> <20151208185818.GD82577@kib.kiev.ua> <20151208190622.GE82577@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_BC57BC0A-AA3E-464E-BE53-94B0B1DD300A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Dec 8, 2015, at 12:06 PM, Konstantin Belousov <kostikbel@gmail.com> =
wrote:
>=20
> On Tue, Dec 08, 2015 at 08:58:18PM +0200, Konstantin Belousov wrote:
>> On Tue, Dec 08, 2015 at 07:44:38PM +0100, Dag-Erling Sm??rgrav wrote:
>>> Warner Losh <imp@bsdimp.com> writes:
>>>> Dag-Erling Sm??rgrav <des@des.no> writes:
>>>>> But the filesystem does not know whether the underlying storage is
>>>>> electromechanical or solid-state, nor does it know whether the =
user
>>>>> cares much about seek times (unless we introduce the heuristic
>>>>> "avoid creating holes unless the file already has them, in which
>>>>> case the userland probably does not care").
>>>> Actually, the filesystem does know. Or has some knowledge of what
>>>> is supported and what isn't. BIO_DELETE support is a strong =
indicator
>>>> of a flash or other log-type system.
>>>=20
>>> 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).
>> I again agree.  This is how UFS issues TRIM.  When the data block is =
freed
>> and there are no dandling pointers in the inode copy on disk pointing =
to
>> the block, BIO_DELETE is issued if volume reports it.  Everything =
else
>> is up to the geom stack and driver.
> I am sorry for the followup mail, but I probably have to explain more.
> The freed block, for which BIO_DELETE is issued, is not marked as free
> in the bitmap, until the BIO_DELETE completion is reported. In other
> words, we do not reuse the freed block while TRIM command is possibly
> executed.

Since the BIO_DELETE queue up in the storage layer, and we make no =
requirement
on ordering[*] in the storage layer, this is prudent. A BIO_WRITE could =
overtake the
BIO_DELETE, which would be bad.

Warner

[*] Well, apart from BIO_ORDERED which isn=E2=80=99t used for BIO_DELETE =
requests
and generally is only needed in FreeBSD to ensure that writes are =
flushed out
(with BIO_FLUSH) in a particular order for power-fail recovery.


--Apple-Mail=_BC57BC0A-AA3E-464E-BE53-94B0B1DD300A
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJWZy0wAAoJEGwc0Sh9sBEAbJEQAIC1gd3LTznddZhgW+zwheyV
JPaStJjcQCHUSb3DRzs+s+r7nMqMmUCSzqTUZEIwVEet8MT3lhUt8vQ+V7eC8EjF
pGihuaVXPfqSMBZA9wl4OG1R4szXbNVNtz56ZmZpWXLnLdTwoVdR0Qbbqg5KbtXm
cRdYRyAfEP8RJ7FeTB8rmYjsAFrm93R9oqI5415j8jX/eIOUjpsZJOVKmJzNSAMZ
DtYMTUtMrx/UHi97PEnh4DhUs8O2D/jGjIke3khQtsLc4oluizMlkuxSq+fOH7sc
NOS1pHwSFrj8OK6hh5MrLytHqXYecnouKMSWylyTp0gPsA0QZ+4ua5uJYh0oyWqo
w1RjUqTUQQxGQeK61F7/s1cTn2GgR2GyNIWB/XTdn8rUbDZU8439j742Vz7jc8XQ
+kQD6SA2H/+7WM0VjvZ/E0EPSIYAu5r4MhwE7xd38HOsfTukBiLUGCELPdqyAlqI
rWEQAt7Jbfndi7w6z6lnbIEg7t1tifmXRVgWVMmHBf3hMJD28LdmGBdLYRjACy+e
+qg+entLA9sLK2PCv4wZOqCsTiSfM7dLIW+6i4Urau9yfoLhFBpH0d7AcXZTug/D
mWxcbW/6DSqBWBXtedpGPnSi5/vv4MD47p9bf3zq1a0s5dALfmm4bgg8/Y/kUreY
qlXgGo12PmihfIoLgYNt
=qcyS
-----END PGP SIGNATURE-----

--Apple-Mail=_BC57BC0A-AA3E-464E-BE53-94B0B1DD300A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0A599E1F-FF63-4F21-B765-44A4531968DB>