]> git.proxmox.com Git - mirror_spl.git/commit
Don't take spin lock on rwlock owner
authorChunwei Chen <tuxoko@gmail.com>
Tue, 1 Sep 2015 13:55:06 +0000 (21:55 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 2 Oct 2015 18:20:55 +0000 (11:20 -0700)
commit4f8e643afe9d8cc558566e1dda05ef597cb2526e
tree202503784add9f177cfa973b52b31416d70f22e4
parent3e1e4c735c4452c137443d7e7dfbe75447dc8e00
Don't take spin lock on rwlock owner

The spin lock around rw_owner is completely unnecessary. The reason is that it
is only modified in the down_write context. If you race against another thread
modifying it, that means that you aren't holding the rwlock, so taking the
spin lock don't eliminate the race.

Also, we only check rw_owner in RW_WRITE_HELD because spl_rwsem_is_locked
is unnecessary and might need to take spin lock.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #473
include/sys/rwlock.h