]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Optimisation of TRIM processing.
authorsmh <smh@FreeBSD.org>
Thu, 21 Mar 2013 11:02:08 +0000 (11:02 +0000)
committersmh <smh@FreeBSD.org>
Thu, 21 Mar 2013 11:02:08 +0000 (11:02 +0000)
commite419fea8b4bd0b241b7ee7aebd6cb0bb817a7231
tree1b2a255f3de87505dc5b5a0664ca8bacd996e251
parent976f4808aa80d36223d5345a31620f37c6230ab7
Optimisation of TRIM processing.

Previously TRIM processing was very bursty. This was made worse by the fact
that TRIM requests on SSD's are typically much slower than reads or writes.
This often resulted in stalls while large numbers of TRIM's where processed.

In addition due to the way the TRIM thread was only woken by writes, deletes
could stall in the queue for extensive periods of time.

This patch adds a number of controls to how often the TRIM thread for each
SPA processes its outstanding delete requests.
vfs.zfs.trim.timeout: Delay TRIMs by up to this many seconds
vfs.zfs.trim.txg_delay: Delay TRIMs by up to this many TXGs (reduced to 32)
vfs.zfs.vdev.trim_max_bytes: Maximum pending TRIM bytes for a vdev
vfs.zfs.vdev.trim_max_pending: Maximum pending TRIM segments for a vdev
vfs.zfs.trim.max_interval: Maximum interval between TRIM queue processing
(seconds)

Given the most common TRIM implementation is ATA TRIM the current defaults
are targeted at that.

Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
MFC after: 2 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c