[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180830141713.GN24082@hirez.programming.kicks-ass.net>
Date: Thu, 30 Aug 2018 16:17:13 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>
Cc: "will.deacon@....com" <will.deacon@....com>,
"mingo@...nel.org" <mingo@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Alexey.Brodkin@...opsys.com" <Alexey.Brodkin@...opsys.com>,
"Vineet.Gupta1@...opsys.com" <Vineet.Gupta1@...opsys.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-snps-arc@...ts.infradead.org"
<linux-snps-arc@...ts.infradead.org>,
"yamada.masahiro@...ionext.com" <yamada.masahiro@...ionext.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: Patch "asm-generic/bitops/lock.h: Rewrite using atomic_fetch_"
causes kernel crash
On Thu, Aug 30, 2018 at 11:53:17AM +0000, Eugeniy Paltsev wrote:
> I can see crashes with LLSC enabled in both SMP running on 4 cores
> and SMP running on 1 core.
So you're running on LL/SC enabled hardware; that would make Will's
patch irrelevant (although still a good idea for the hardware that does
care about that spinlocked atomic crud).
Does something like the below cure things? That would confirm the
suggestion that the change to __clear_bit_unlock() is the curprit.
If that doesn't cure things, then we've been looking in entirely the
wrong place.
---
diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h
index 3ae021368f48..79c6978152f8 100644
--- a/include/asm-generic/bitops/lock.h
+++ b/include/asm-generic/bitops/lock.h
@@ -57,12 +57,7 @@ static inline void clear_bit_unlock(unsigned int nr, volatile unsigned long *p)
static inline void __clear_bit_unlock(unsigned int nr,
volatile unsigned long *p)
{
- unsigned long old;
-
- p += BIT_WORD(nr);
- old = READ_ONCE(*p);
- old &= ~BIT_MASK(nr);
- atomic_long_set_release((atomic_long_t *)p, old);
+ clear_bit_unlock(nr, p);
}
/**
Powered by blists - more mailing lists