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


Groups > linux.kernel > #1237490

Re: [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 Catalin Marinas <catalin.marinas@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] arm64: replace read_lock to rcu lock in call_break_hook
Date Thu, 01 Oct 2015 17:10:02 +0200
Message-ID <qeNEC-8aM-13@gated-at.bofh.it> (permalink)
References <qeyPg-2Iv-5@gated-at.bofh.it>
X-Original-To Yang Shi <yang.shi@linaro.org>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
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 30
Organization linux.* mail to news gateway
X-Original-Cc rostedt@goodmis.org, will.deacon@arm.com, dave.long@linaro.org, panand@redhat.com, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rt-users@vger.kernel.org
X-Original-Date Thu, 1 Oct 2015 16:07:35 +0100
X-Original-Message-ID <20151001150735.GH6963@e104818-lin.cambridge.arm.com>
X-Original-References <1443653944-21885-1-git-send-email-yang.shi@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1237490

Show key headers only | View raw


On Wed, Sep 30, 2015 at 03:59:04PM -0700, Yang Shi wrote:
> 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
--
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 | NextPrevious in thread | Next 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