Thread (3 messages) 3 messages, 2 authors, 2015-10-01

[PATCH] arm64: replace read_lock to rcu lock in call_break_hook

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2015-10-01 15:07:44
Also in: linux-rt-users, lkml

On Wed, Sep 30, 2015 at 03:59:04PM -0700, Yang Shi wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index cebf786..eb520d0 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -292,11 +292,11 @@ static int call_break_hook(struct pt_regs *regs, unsigned int esr)
 	struct break_hook *hook;
 	int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
 
-	read_lock(&break_hook_lock);
+	rcu_read_lock();
 	list_for_each_entry(hook, &break_hook, node)
 		if ((esr & hook->esr_mask) == hook->esr_val)
 			fn = hook->fn;
-	read_unlock(&break_hook_lock);
+	rcu_read_unlock();
 
 	return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
 }
That's not enough, you also need list_(add|del)_rcu where the list is
modified, together with list_for_each_entry_rcu() here.

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