HomeFreeBSD

Reintroduce zfs_remove() synchronous deletes

Description

Reintroduce zfs_remove() synchronous deletes

Reintroduce a slightly adapted version of the Illumos logic for
synchronous unlinks. The basic idea here is that only files
smaller than zfs_delete_blocks (20480) blocks should be deleted
synchronously. Unlinking larger files should be handled
asynchronously to minimize impact to the caller.

To accomplish this iput() which is responsible for calling
zfs_znode_delete() on Linux is only called in the delete_now
path. Otherwise zfs_async_iput() is used which allows the
last reference to be dropped by a taskq thread effectively
making the removal asynchronous.

Porting notes:

  • Add zfs_delete_blocks module option for performance analysis. The default value is DMU_MAX_DELETEBLKCNT which is the same as upstream. Reducing this value means that smaller files will be unlinked asynchronously like large files.
  • All occurrences of zfsvfs changes to zsb.

Ported-by: KernelOfTruth kerneloftruth@gmail.com
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Details

Provenance
kernelOfTruth <kerneloftruth@gmail.com>Authored on Aug 21 2015, 1:43 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 26 2016, 11:26 PM
Parents
rG460a021391d3: Log zvol truncate/discard operations
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGa966c5640e43: Reintroduce zfs_remove() synchronous deletes (authored by kernelOfTruth <kerneloftruth@gmail.com>).Jan 26 2016, 11:26 PM