summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior2017-06-27 18:16:47 +0200
committerJoerg Roedel2017-06-28 12:23:01 +0200
commitaaffaa8a3b5950c47e5f7573c34bc47de8894a18 (patch)
treeefe486589baa4710920092a76c01c97f31ed247b /drivers/iommu/iommu.c
parentLinux 4.12-rc7 (diff)
downloadkernel-qcow2-linux-aaffaa8a3b5950c47e5f7573c34bc47de8894a18.tar.gz
kernel-qcow2-linux-aaffaa8a3b5950c47e5f7573c34bc47de8894a18.tar.xz
kernel-qcow2-linux-aaffaa8a3b5950c47e5f7573c34bc47de8894a18.zip
iommu/iova: Don't disable preempt around this_cpu_ptr()
Commit 583248e6620a ("iommu/iova: Disable preemption around use of this_cpu_ptr()") disables preemption while accessing a per-CPU variable. This does keep lockdep quiet. However I don't see the point why it is bad if we get migrated after its access to another CPU. __iova_rcache_insert() and __iova_rcache_get() immediately locks the variable after obtaining it - before accessing its members. _If_ we get migrated away after retrieving the address of cpu_rcache before taking the lock then the *other* task on the same CPU will retrieve the same address of cpu_rcache and will spin on the lock. alloc_iova_fast() disables preemption while invoking free_cpu_cached_iovas() on each CPU. The function itself uses per_cpu_ptr() which does not trigger a warning (like this_cpu_ptr() does). It _could_ make sense to use get_online_cpus() instead but the we have a hotplug notifier for CPU down (and none for up) so we are good. Cc: Joerg Roedel <joro@8bytes.org> Cc: iommu@lists.linux-foundation.org Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/iommu.c')
0 files changed, 0 insertions, 0 deletions