[PATCH] powerpc/kernel: Avoid preemption check during iommu_range_alloc

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3283d

2 messages, 2 authors, 2017-08-07 · open the first message on its own page

[PATCH] powerpc/kernel: Avoid preemption check during iommu_range_alloc

From: Victor Aoqui <hidden>
Date: 2017-07-20 17:26:16

Replaced __this_cpu_read function call by raw_cpu_read in
iommu_range_alloc function.
Preemption doesn't need to be disabled since any CPU can safely
use IOMMU pool.

Signed-off-by: Victor Aoqui <redacted>
---
 arch/powerpc/kernel/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 233ca3f..0e49a45 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -208,7 +208,7 @@ static unsigned long iommu_range_alloc(struct device *dev,
 	 * We don't need to disable preemption here because any CPU can
 	 * safely use any IOMMU pool.
 	 */
-	pool_nr = __this_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1);
+	pool_nr = raw_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1);
 
 	if (largealloc)
 		pool = &(tbl->large_pool);
-- 
1.8.3.1

Re: powerpc/kernel: Avoid preemption check during iommu_range_alloc

From: Michael Ellerman <hidden>
Date: 2017-08-07 10:41:58

On Thu, 2017-07-20 at 17:26:06 UTC, victora wrote:
Replaced __this_cpu_read function call by raw_cpu_read in
iommu_range_alloc function.
Preemption doesn't need to be disabled since any CPU can safely
use IOMMU pool.

Signed-off-by: Victor Aoqui <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/75f327c6b75715f3a090daeb33e050

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help