Page MenuHomeFreeBSD

Reduce object locking in zfs.
ClosedPublic

Authored by jeff on Feb 27 2020, 3:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 25, 9:21 AM
Unknown Object (File)
Fri, May 17, 7:22 PM
Unknown Object (File)
May 10 2024, 12:30 PM
Unknown Object (File)
May 10 2024, 12:29 PM
Unknown Object (File)
May 10 2024, 12:29 PM
Unknown Object (File)
May 9 2024, 7:13 PM
Unknown Object (File)
Apr 23 2024, 11:54 AM
Unknown Object (File)
Jan 17 2024, 8:52 PM

Details

Summary

The VM no longer requires the object lock to lookup pages. If it need to create pages, it will acquire it depending on grab flags.

I have tested this only with the zfs tests in the stress2 suite. I have not performance tested it. In some workloads on larger machines the win is substantial for things like exec/tmpfs/md/buf cache/fault.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jeff added reviewers: kib, markj, mav, mmacy.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
This revision is now accepted and ready to land.Feb 27 2020, 1:58 PM

I think deadlock at https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076100.html may be related to this but I don't understand a lot of it.
Edit: Nevermind, reverting did not help. Sorry for the noise.

I think deadlock at https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076100.html may be related to this but I don't understand a lot of it.

The basic problem is an LOR between the page busy lock and ZFS range locks. zfs_write() locks the range, performs the write, and then harmonizes the update with data in the page cache. This last operation is done in update_pages(), and busies the VM's copy of the data. In the other thread, vm_fault() busies the fault page during a read fault and then calls zfs_getpages(), which locks the range.