]> git.proxmox.com Git - mirror_spl.git/commit
Retire MUTEX_OWNER checks
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 25 Feb 2015 18:23:49 +0000 (10:23 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 3 Mar 2015 18:13:33 +0000 (10:13 -0800)
commit5f920fbee1fd1838bad2d5a262041a3a171b6834
tree7397b94326be519d11025b09be326058d3630a3d
parenta900e28e71d51687e64761e981b953bd1d80f85c
Retire MUTEX_OWNER checks

To minimize the size of a kmutex_t a MUTEX_OWNER check was added.
It allowed the kmutex_t wrapper to leverage the mutex owner which was
already stored in the mutex for certain kernel configurations.

The upside to this was that it reduced the size of the kmutex_t wrapper
structure by the size of a task_struct pointer (4/8 bytes).  The
downside was that two mutex implementations needed to be maintained.
Depending on your exact kernel configuration the correct one would
be selected.

Over the years this solution worked but it could be fragile since it
depending heavily on assumed kernel mutex implementation details.  For
example the SPL_AC_MUTEX_OWNER_TASK_STRUCT configure check needed to
be added when the kernel changed how the owner was stored.  It also
made the code more complicated than it needed to be.

Therefore, in the name of simplicity and portability this optimization
is being retired.  It will slightly increase the memory requirements
for a kmutex_t but only very slightly.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #435
config/spl-build.m4
include/sys/mutex.h