mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
fdcb79b52e
This checking breaks KMSAN since it effectively loads from uninitialized memory to see if the lock is already initialized. This happens in dnode_cons() for example. This checking is not very useful, partly due to UMA's memory trashing, and is already disabled for mutexes. Make mutexes and rwlocks consistent: remove double-initialization checking for rwlocks, and pass SX_NEW to disable the same checking in lock_init(). No functional change intended, this affects only debug builds. As a side note, kmem cache constructors/destructors are implemented suboptimally on FreeBSD. FreeBSD's slab allocator, UMA, supports two pairs of constructors/destructors: ctor/dtor and init/fini. The former are called upon every allocation and free of an item, while the latter are called when an item is imported or released from a zone, respectively. That is, when a slab is allocated to a particular cache, it is subdivided into items, and init is called on each. fini is called when the slab is being prepared to be freed back to the system. The intent is for them to initialize static fields such as locks, which do not need to be initialized upon each allocation of an item. In illumos, kmem_cache constructors/destructors correspond to UMA's init/fini callbacks. However, in the SPL they are implemented as UMA ctor/dtors, meaning that they get called far more often than necessary. This may be difficult to fix, since new code may assume the kmem cache ctor/dtors are in fact called upon each allocation/free, and there doesn't seem to be a clear way to implement the intended semantics on Linux. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Mark Johnston <markj@FreeBSD.org> Closes #13019 |
||
---|---|---|
.. | ||
freebsd | ||
linux | ||
Makefile.am |