From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Peter Zijlstra <peterz@infradead.org>, Will Deacon <will.deacon@arm.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
"mingo@kernel.org" <mingo@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Alexey.Brodkin@synopsys.com" <Alexey.Brodkin@synopsys.com>,
"Vineet.Gupta1@synopsys.com" <Vineet.Gupta1@synopsys.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"yamada.masahiro@socionext.com" <yamada.masahiro@socionext.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: Patch "asm-generic/bitops/lock.h: Rewrite using atomic_fetch_" causes kernel crash
Date: Thu, 30 Aug 2018 20:31:59 +0000 [thread overview]
Message-ID: <C2D7FE5348E1B147BCA15975FBA23075012B090EA4@us01wembx1.internal.synopsys.com> (raw)
In-Reply-To: 20180830142920.GO24082@hirez.programming.kicks-ass.net
On 08/30/2018 07:29 AM, Peter Zijlstra wrote:
> On Thu, Aug 30, 2018 at 03:23:55PM +0100, Will Deacon wrote:
>
>> Yes, that would be worth trying. However, I also just noticed that the
>> fetch-ops (which are now used to implement test_and_set_bit_lock()) seem
>> to be missing the backwards branch in the LL/SC case. Yet another diff
>> below.
>>
>> Will
>>
>> --->8
>>
>> diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h
>> index 4e0072730241..f06c5ed672b3 100644
>> --- a/arch/arc/include/asm/atomic.h
>> +++ b/arch/arc/include/asm/atomic.h
>> @@ -84,7 +84,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \
>> "1: llock %[orig], [%[ctr]] \n" \
>> " " #asm_op " %[val], %[orig], %[i] \n" \
>> " scond %[val], [%[ctr]] \n" \
>> - " \n" \
>> + " bnz 1b \n" \
>> : [val] "=&r" (val), \
>> [orig] "=&r" (orig) \
>> : [ctr] "r" (&v->counter), \
> ACK!! sorry about that, no idea how I messed that up.
>
> Also, once it all works, they should look at switching to _relaxed
> atomics for LL/SC.
Indeed this is the mother of all issues, I tried and system is clearly hosed with
and works after.
What's amazing is the commit 4aef66c8ae9 which introduced it is from 2016 ;-)
Back then we had a retry branch with backoff stuff which I'd reverted for new
cores and the merge conflict somehow missed it.
@PeterZ I'll create a patch with you as author ? do I need any formal sign offs,
acks etc ?
So after this there are 2 other things to be addresses / looked at still while we
are still here.
1. After 84c6591103db __clear_bit_lock() implementation will be broken (or atleast
not consistent with what we had after), do we need to reinstate it.
2. Will's proposed change to remove the underlying issue, but the issue in #1
remains ?
-Vineet
WARNING: multiple messages have this Message-ID (diff)
From: Vineet.Gupta1@synopsys.com (Vineet Gupta)
To: linux-snps-arc@lists.infradead.org
Subject: Patch "asm-generic/bitops/lock.h: Rewrite using atomic_fetch_" causes kernel crash
Date: Thu, 30 Aug 2018 20:31:59 +0000 [thread overview]
Message-ID: <C2D7FE5348E1B147BCA15975FBA23075012B090EA4@us01wembx1.internal.synopsys.com> (raw)
In-Reply-To: 20180830142920.GO24082@hirez.programming.kicks-ass.net
On 08/30/2018 07:29 AM, Peter Zijlstra wrote:
> On Thu, Aug 30, 2018@03:23:55PM +0100, Will Deacon wrote:
>
>> Yes, that would be worth trying. However, I also just noticed that the
>> fetch-ops (which are now used to implement test_and_set_bit_lock()) seem
>> to be missing the backwards branch in the LL/SC case. Yet another diff
>> below.
>>
>> Will
>>
>> --->8
>>
>> diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h
>> index 4e0072730241..f06c5ed672b3 100644
>> --- a/arch/arc/include/asm/atomic.h
>> +++ b/arch/arc/include/asm/atomic.h
>> @@ -84,7 +84,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \
>> "1: llock %[orig], [%[ctr]] \n" \
>> " " #asm_op " %[val], %[orig], %[i] \n" \
>> " scond %[val], [%[ctr]] \n" \
>> - " \n" \
>> + " bnz 1b \n" \
>> : [val] "=&r" (val), \
>> [orig] "=&r" (orig) \
>> : [ctr] "r" (&v->counter), \
> ACK!! sorry about that, no idea how I messed that up.
>
> Also, once it all works, they should look at switching to _relaxed
> atomics for LL/SC.
Indeed this is the mother of all issues, I tried and system is clearly hosed with
and works after.
What's amazing is the commit 4aef66c8ae9 which introduced it is from 2016 ;-)
Back then we had a retry branch with backoff stuff which I'd reverted for new
cores and the merge conflict somehow missed it.
@PeterZ I'll create a patch with you as author ? do I need any formal sign offs,
acks etc ?
So after this there are 2 other things to be addresses / looked at still while we
are still here.
1. After 84c6591103db __clear_bit_lock() implementation will be broken (or atleast
not consistent with what we had after), do we need to reinstate it.
2. Will's proposed change to remove the underlying issue, but the issue in #1
remains ?
-Vineet
WARNING: multiple messages have this Message-ID (diff)
From: Vineet.Gupta1@synopsys.com (Vineet Gupta)
To: linux-arm-kernel@lists.infradead.org
Subject: Patch "asm-generic/bitops/lock.h: Rewrite using atomic_fetch_" causes kernel crash
Date: Thu, 30 Aug 2018 20:31:59 +0000 [thread overview]
Message-ID: <C2D7FE5348E1B147BCA15975FBA23075012B090EA4@us01wembx1.internal.synopsys.com> (raw)
In-Reply-To: 20180830142920.GO24082@hirez.programming.kicks-ass.net
On 08/30/2018 07:29 AM, Peter Zijlstra wrote:
> On Thu, Aug 30, 2018 at 03:23:55PM +0100, Will Deacon wrote:
>
>> Yes, that would be worth trying. However, I also just noticed that the
>> fetch-ops (which are now used to implement test_and_set_bit_lock()) seem
>> to be missing the backwards branch in the LL/SC case. Yet another diff
>> below.
>>
>> Will
>>
>> --->8
>>
>> diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h
>> index 4e0072730241..f06c5ed672b3 100644
>> --- a/arch/arc/include/asm/atomic.h
>> +++ b/arch/arc/include/asm/atomic.h
>> @@ -84,7 +84,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \
>> "1: llock %[orig], [%[ctr]] \n" \
>> " " #asm_op " %[val], %[orig], %[i] \n" \
>> " scond %[val], [%[ctr]] \n" \
>> - " \n" \
>> + " bnz 1b \n" \
>> : [val] "=&r" (val), \
>> [orig] "=&r" (orig) \
>> : [ctr] "r" (&v->counter), \
> ACK!! sorry about that, no idea how I messed that up.
>
> Also, once it all works, they should look at switching to _relaxed
> atomics for LL/SC.
Indeed this is the mother of all issues, I tried and system is clearly hosed with
and works after.
What's amazing is the commit 4aef66c8ae9 which introduced it is from 2016 ;-)
Back then we had a retry branch with backoff stuff which I'd reverted for new
cores and the merge conflict somehow missed it.
@PeterZ I'll create a patch with you as author ? do I need any formal sign offs,
acks etc ?
So after this there are 2 other things to be addresses / looked at still while we
are still here.
1. After 84c6591103db __clear_bit_lock() implementation will be broken (or atleast
not consistent with what we had after), do we need to reinstate it.
2. Will's proposed change to remove the underlying issue, but the issue in #1
remains ?
-Vineet
next prev parent reply other threads:[~2018-08-30 20:32 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 18:33 Patch "asm-generic/bitops/lock.h: Rewrite using atomic_fetch_" causes kernel crash Eugeniy Paltsev
2018-08-29 18:33 ` Eugeniy Paltsev
2018-08-29 18:33 ` Eugeniy Paltsev
2018-08-29 18:33 ` Eugeniy Paltsev
2018-08-29 21:16 ` Vineet Gupta
2018-08-29 21:16 ` Vineet Gupta
2018-08-29 21:16 ` Vineet Gupta
2018-08-29 21:16 ` Vineet Gupta
2018-08-30 9:35 ` Will Deacon
2018-08-30 9:35 ` Will Deacon
2018-08-30 9:35 ` Will Deacon
2018-08-30 9:35 ` Will Deacon
2018-08-30 9:44 ` Peter Zijlstra
2018-08-30 9:44 ` Peter Zijlstra
2018-08-30 9:44 ` Peter Zijlstra
2018-08-30 9:44 ` Peter Zijlstra
2018-08-30 9:44 ` Peter Zijlstra
2018-08-30 9:51 ` Will Deacon
2018-08-30 9:51 ` Will Deacon
2018-08-30 9:51 ` Will Deacon
2018-08-30 9:51 ` Will Deacon
2018-08-30 11:53 ` Eugeniy Paltsev
2018-08-30 11:53 ` Eugeniy Paltsev
2018-08-30 11:53 ` Eugeniy Paltsev
2018-08-30 11:53 ` Eugeniy Paltsev
2018-08-30 13:57 ` Will Deacon
2018-08-30 13:57 ` Will Deacon
2018-08-30 13:57 ` Will Deacon
2018-08-30 13:57 ` Will Deacon
2018-08-30 14:17 ` Peter Zijlstra
2018-08-30 14:17 ` Peter Zijlstra
2018-08-30 14:17 ` Peter Zijlstra
2018-08-30 14:17 ` Peter Zijlstra
2018-08-30 14:17 ` Peter Zijlstra
2018-08-30 14:23 ` Will Deacon
2018-08-30 14:23 ` Will Deacon
2018-08-30 14:23 ` Will Deacon
2018-08-30 14:23 ` Will Deacon
2018-08-30 14:29 ` Peter Zijlstra
2018-08-30 14:29 ` Peter Zijlstra
2018-08-30 14:29 ` Peter Zijlstra
2018-08-30 14:29 ` Peter Zijlstra
2018-08-30 14:43 ` Peter Zijlstra
2018-08-30 14:43 ` Peter Zijlstra
2018-08-30 14:43 ` Peter Zijlstra
2018-08-30 14:43 ` Peter Zijlstra
2018-08-30 14:43 ` Peter Zijlstra
2020-04-14 1:19 ` Vineet Gupta
2020-04-14 1:19 ` Vineet Gupta
2020-04-14 1:19 ` Vineet Gupta
2020-04-14 1:19 ` Vineet Gupta
2018-08-30 20:31 ` Vineet Gupta [this message]
2018-08-30 20:31 ` Vineet Gupta
2018-08-30 20:31 ` Vineet Gupta
2018-08-30 20:31 ` Vineet Gupta
2018-08-30 20:45 ` Peter Zijlstra
2018-08-30 20:45 ` Peter Zijlstra
2018-08-30 20:45 ` Peter Zijlstra
2018-08-30 20:45 ` Peter Zijlstra
2018-08-30 20:45 ` Peter Zijlstra
2018-08-31 0:30 ` Vineet Gupta
2018-08-31 0:30 ` Vineet Gupta
2018-08-31 0:30 ` Vineet Gupta
2018-08-31 0:30 ` Vineet Gupta
2018-08-31 9:53 ` Will Deacon
2018-08-31 9:53 ` Will Deacon
2018-08-31 9:53 ` Will Deacon
2018-08-31 9:53 ` Will Deacon
2018-08-30 14:46 ` Eugeniy Paltsev
2018-08-30 14:46 ` Eugeniy Paltsev
2018-08-30 14:46 ` Eugeniy Paltsev
2018-08-30 14:46 ` Eugeniy Paltsev
2018-08-30 14:46 ` Eugeniy Paltsev
2018-08-30 17:15 ` Peter Zijlstra
2018-08-30 17:15 ` Peter Zijlstra
2018-08-30 17:15 ` Peter Zijlstra
2018-08-30 17:15 ` Peter Zijlstra
2018-08-31 0:42 ` Vineet Gupta
2018-08-31 0:42 ` Vineet Gupta
2018-08-31 0:42 ` Vineet Gupta
2018-08-31 0:42 ` Vineet Gupta
2018-08-31 0:29 ` __clear_bit_lock to use atomic clear_bit (was Re: Patch "asm-generic/bitops/lock.h) Vineet Gupta
2018-08-31 0:29 ` Vineet Gupta
2018-08-31 0:29 ` Vineet Gupta
2018-08-31 0:29 ` Vineet Gupta
2018-08-31 7:24 ` Peter Zijlstra
2018-08-31 7:24 ` Peter Zijlstra
2018-08-31 7:24 ` Peter Zijlstra
2018-08-31 7:24 ` Peter Zijlstra
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=C2D7FE5348E1B147BCA15975FBA23075012B090EA4@us01wembx1.internal.synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
--cc=yamada.masahiro@socionext.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.