lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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).



\
 
 \ /
  Last update: 2015-03-13 17:41    [W:0.084 / U:7.928 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site