Hi Catalin,
> On Thu, 2010-03-04 at 17:28 +0000, Will Deacon wrote:
> > I took a quick look at the code in kernel/kgdb.c and adding the following
> > memory barrier appears to resolve the issue:
> >
> > diff --git a/kernel/kgdb.c b/kernel/kgdb.c
> > index 761fdd2..1308381 100644
> > --- a/kernel/kgdb.c
> > +++ b/kernel/kgdb.c
> > @@ -1537,6 +1537,7 @@ acquirelock:
> > * Wait till all the CPUs have quit
> > * from the debugger.
> > */
> > + smp_wmb();
> > for_each_online_cpu(i) {
> > while (atomic_read(&cpu_in_kgdb[i]))
> > cpu_relax();
>
> Shouldn't this be smp_rmb()?
Actually, I think that we need an smp_mb() because there is
another variable involved (passive_cpu_wait[i]) as well as
cpu_in_kgdb[i], both of which are being read from and written
to.
I think deadlock occurs because the store buffers don't drain
on the 11MPCore, so the CPUs happily cpu_relax() while polling
on variables that they will never see change. Perhaps cpu_relax()
should be defined to be something stronger than a compiler memory
barrier for ARM?
Will
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport