All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shi, Yang" <yang.shi@linaro.org>
To: Catalin Marinas <catalin.marinas@arm.com>
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
Subject: Re: [PATCH] arm64: replace read_lock to rcu lock in call_break_hook
Date: Thu, 01 Oct 2015 09:03:05 -0700	[thread overview]
Message-ID: <560D5939.7080107@linaro.org> (raw)
In-Reply-To: <20151001150735.GH6963@e104818-lin.cambridge.arm.com>

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

>


WARNING: multiple messages have this Message-ID (diff)
From: yang.shi@linaro.org (Shi, Yang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: replace read_lock to rcu lock in call_break_hook
Date: Thu, 01 Oct 2015 09:03:05 -0700	[thread overview]
Message-ID: <560D5939.7080107@linaro.org> (raw)
In-Reply-To: <20151001150735.GH6963@e104818-lin.cambridge.arm.com>

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

>

  reply	other threads:[~2015-10-01 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 22:59 [PATCH] arm64: replace read_lock to rcu lock in call_break_hook Yang Shi
2015-09-30 22:59 ` Yang Shi
2015-10-01 15:07 ` Catalin Marinas
2015-10-01 15:07   ` Catalin Marinas
2015-10-01 16:03   ` Shi, Yang [this message]
2015-10-01 16:03     ` Shi, Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560D5939.7080107@linaro.org \
    --to=yang.shi@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=dave.long@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=panand@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.