[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <560D5939.7080107@linaro.org>
Date: Thu, 01 Oct 2015 09:03:05 -0700
From: "Shi, Yang" <yang.shi@...aro.org>
To: Catalin Marinas <catalin.marinas@....com>
CC: rostedt@...dmis.org, will.deacon@....com, dave.long@...aro.org,
panand@...hat.com, linaro-kernel@...ts.linaro.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rt-users@...r.kernel.org
Subject: Re: [PATCH] arm64: replace read_lock to rcu lock in call_break_hook
On 10/1/2015 8:07 AM, Catalin Marinas wrote:
> 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.
Thanks for pointing it out. I'm going to prepare v2 with list_(add|del)_rcu.
Yang
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists