[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.02.1105041501300.3005@ionos>
Date: Wed, 4 May 2011 15:02:37 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Ingo Molnar <mingo@...e.hu>
cc: Pekka Enberg <penberg@...nel.org>, Tejun Heo <tj@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jens Axboe <axboe@...nel.dk>,
Andrew Morton <akpm@...ux-foundation.org>,
werner <w.landgraf@...ru>, "H. Peter Anvin" <hpa@...or.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Christoph Lameter <cl@...ux.com>
Subject: Re: [block IO crash] Re: 2.6.39-rc5-git2 boot crashs
On Wed, 4 May 2011, Ingo Molnar wrote:
> * Pekka Enberg <penberg@...nel.org> wrote:
>
> > Hi Tejun,
> >
> > On Wed, May 4, 2011 at 2:27 PM, Tejun Heo <tj@...nel.org> wrote:
> > > Hmmm... if it's a race caused by preemtion enabled where it shouldn't
> > > be, it's most likely the wrong type of this_cpu_cmpxchg_double() being
> > > used in SLUB? ie. __this_cpu_cmpxchg_double() where it should have
> > > been this_cpu_cmpxchg_double()? Christoph?
> >
> > There's no __this_cpu_cmpxchg_double() usage in mm/slub.c so I don't
> > think it's that simple.
>
> Well, AFAICS the problem is:
>
> earth4:~/tip> grep cmpxchg mm/slub.c
>
> if (unlikely(!this_cpu_cmpxchg_double(
> if (unlikely(!this_cpu_cmpxchg_double(
>
> Where this macro resolves to:
>
> # define this_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \
> _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
>
> where:
>
> #define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
> ({ \
> int ret__; \
> preempt_disable(); \
> ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \
> oval1, oval2, nval1, nval2); \
> preempt_enable();
> where:
>
> #define __this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
> ({ \
> int __ret = 0; \
> if (__this_cpu_read(pcp1) == (oval1) && \
> __this_cpu_read(pcp2) == (oval2)) { \
> __this_cpu_write(pcp1, (nval1)); \
> __this_cpu_write(pcp2, (nval2)); \
> __ret = 1; \
> } \
> (__ret); \
> })
>
> With is both IRQ and SMP unsafe.
SMP is not an issue because that's cpu local access, but it's
irq/softirq unsafe. See my other mail.
Thanks,
tglx
Powered by blists - more mailing lists