Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236852

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

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Yang Shi <yang.shi@linaro.org>
Newsgroups linux.kernel
Subject [PATCH] arm64: replace read_lock to rcu lock in call_break_hook
Date Thu, 01 Oct 2015 01:20:02 +0200
Message-ID <qeyPg-2Iv-5@gated-at.bofh.it> (permalink)
X-Original-To rostedt@goodmis.org, catalin.marinas@arm.com, will.deacon@arm.com, dave.long@linaro.org, panand@redhat.com
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UplP2vFaqSGrO/Lbk+0f0m2f0rqW3nN6Vp6pNX5m/kY=; b=P8iKMP+AOWw2dKg814ooiHiY8h3yBjiST1hzY15pLMVaOoZOWOHM0lhosA6de1Wf4n H+krm5stG21wW34IGFXjqJ804crbQFOnMnt5X5PKK03MCOOvLlKErHkxkTCJNYrPu+Kx XF29a/i7y2O2eEJYKc+2yM/IWP+h3Bl1O0cXE22Vln7UUen7PSXXwKi+NgHNdtGUTzpA cjfZl0ZWEUgqeRP3r9mf5CNOD+sXlbLMUcndymRt63sV1bEjjVMzpjFB7fjokFn98fbE hBIqgtkzRl8CCV8aNypBCGi6DrrH6twyUVPkKWBUiBbDP1d25g0Ap5Sl7QtKQMWAjceA 0d/Q==
X-Gm-Message-State ALoCoQm8T1dRUn0hac7f7kxlYjLLk0KXZbv5A0QZzY+bApg1pxVNBXmL+Ady3mi7IBwnaDQziqVp
X-Received by 10.69.3.228 with SMTP id bz4mr8003501pbd.79.1443654944863; Wed, 30 Sep 2015 16:15:44 -0700 (PDT)
X-Mailer git-send-email 2.0.2
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 67
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org
X-Original-Date Wed, 30 Sep 2015 15:59:04 -0700
X-Original-Message-ID <1443653944-21885-1-git-send-email-yang.shi@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1236852

Show key headers only | View raw


BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917
in_atomic(): 0, irqs_disabled(): 128, pid: 342, name: perf
1 lock held by perf/342:
 #0:  (break_hook_lock){+.+...}, at: [<ffffffc0000851ac>] call_break_hook+0x34/0xd0
irq event stamp: 62224
hardirqs last  enabled at (62223): [<ffffffc00010b7bc>] __call_rcu.constprop.59+0x104/0x270
hardirqs last disabled at (62224): [<ffffffc0000fbe20>] vprintk_emit+0x68/0x640
softirqs last  enabled at (0): [<ffffffc000097928>] copy_process.part.8+0x428/0x17f8
softirqs last disabled at (0): [<          (null)>]           (null)
CPU: 0 PID: 342 Comm: perf Not tainted 4.1.6-rt5 #4
Hardware name: linux,dummy-virt (DT)
Call trace:
[<ffffffc000089968>] dump_backtrace+0x0/0x128
[<ffffffc000089ab0>] show_stack+0x20/0x30
[<ffffffc0007030d0>] dump_stack+0x7c/0xa0
[<ffffffc0000c878c>] ___might_sleep+0x174/0x260
[<ffffffc000708ac8>] __rt_spin_lock+0x28/0x40
[<ffffffc000708db0>] rt_read_lock+0x60/0x80
[<ffffffc0000851a8>] call_break_hook+0x30/0xd0
[<ffffffc000085a70>] brk_handler+0x30/0x98
[<ffffffc000082248>] do_debug_exception+0x50/0xb8
Exception stack(0xffffffc00514fe30 to 0xffffffc00514ff50)
fe20:                                     00000000 00000000 c1594680 0000007f
fe40: ffffffff ffffffff 92063940 0000007f 0550dcd8 ffffffc0 00000000 00000000
fe60: 0514fe70 ffffffc0 000be1f8 ffffffc0 0514feb0 ffffffc0 0008948c ffffffc0
fe80: 00000004 00000000 0514fed0 ffffffc0 ffffffff ffffffff 9282a948 0000007f
fea0: 00000000 00000000 9282b708 0000007f c1592820 0000007f 00083914 ffffffc0
fec0: 00000000 00000000 00000010 00000000 00000064 00000000 00000001 00000000
fee0: 005101e0 00000000 c1594680 0000007f c1594740 0000007f ffffffd8 ffffff80
ff00: 00000000 00000000 00000000 00000000 c1594770 0000007f c1594770 0000007f
ff20: 00665e10 00000000 7f7f7f7f 7f7f7f7f 01010101 01010101 00000000 00000000
ff40: 928e4cc0 0000007f 91ff11e8 0000007f

call_break_hook is called in atomic context (hard irq disabled), so replace
the sleepable lock to rcu lock.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
---
 arch/arm64/kernel/debug-monitors.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
 }
-- 
2.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] arm64: replace read_lock to rcu lock in call_break_hook Yang Shi <yang.shi@linaro.org> - 2015-10-01 01:20 +0200
  Re: [PATCH] arm64: replace read_lock to rcu lock in call_break_hook Catalin Marinas <catalin.marinas@arm.com> - 2015-10-01 17:10 +0200
    Re: [PATCH] arm64: replace read_lock to rcu lock in call_break_hook "Shi, Yang" <yang.shi@linaro.org> - 2015-10-01 18:10 +0200

csiph-web