iommu/s390: Use RCU to allow concurrent domain_list iteration
authorNiklas Schnelle <schnelle@linux.ibm.com>
Wed, 9 Nov 2022 14:29:01 +0000 (15:29 +0100)
committerJoerg Roedel <jroedel@suse.de>
Sat, 19 Nov 2022 09:28:16 +0000 (10:28 +0100)
commit2ba8336dab5fb81452aea9c21dfc870050a017f3
tree28cf21630a2a43438e63a6b8001f32ebd9abc8b8
parentc228f5a043370ef02867e4f0aab1bdc8422500e6
iommu/s390: Use RCU to allow concurrent domain_list iteration

The s390_domain->devices list is only added to when new devices are
attached but is iterated through in read-only fashion for every mapping
operation as well as for I/O TLB flushes and thus in performance
critical code causing contention on the s390_domain->list_lock.
Fortunately such a read-mostly linked list is a standard use case for
RCU. This change closely follows the example fpr RCU protected list
given in Documentation/RCU/listRCU.rst.

Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://lore.kernel.org/r/20221109142903.4080275-4-schnelle@linux.ibm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
arch/s390/include/asm/pci.h
arch/s390/pci/pci.c
drivers/iommu/s390-iommu.c