[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1503131126550.13899@gentwo.org>
Date: Fri, 13 Mar 2015 11:29:23 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Mark Rutland <mark.rutland@....com>
cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Catalin Marinas <catalin.marinas@....com>,
David Rientjes <rientjes@...gle.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Pekka Enberg <penberg@...nel.org>,
Steve Capper <steve.capper@...aro.org>
Subject: Re: [PATCH] mm/slub: fix lockups on PREEMPT && !SMP kernels
On Fri, 13 Mar 2015, Mark Rutland wrote:
> */
> - do {
> - tid = this_cpu_read(s->cpu_slab->tid);
> - c = raw_cpu_ptr(s->cpu_slab);
> - } while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != c->tid));
> + c = raw_cpu_ptr(s->cpu_slab);
> + tid = READ_ONCE(c->tid);
>
Ok that works for the !SMP case. What about SMP and PREEMPT now?
And yes code like this was deemed safe for years and the race condition is
very subtle and difficult to trigger (also given that PREEMPT is rarely
used these days).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists