linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [rfc] SLOB memory ordering issue
@ 2008-10-15 16:34 Nick Piggin
  2008-10-15 16:46 ` Nick Piggin
  2008-10-15 16:54 ` Matt Mackall
  0 siblings, 2 replies; 20+ messages in thread
From: Nick Piggin @ 2008-10-15 16:34 UTC (permalink / raw)
  To: torvalds, Pekka Enberg, Matt Mackall, linux-mm, linux-kernel

I think I see a possible memory ordering problem with SLOB:
In slab caches with constructors, the constructor is run
before returning the object to caller, with no memory barrier
afterwards.

Now there is nothing that indicates the _exact_ behaviour
required here. Is it at all reasonable to expect ->ctor() to
be visible to all CPUs and not just the allocating CPU?

SLAB and SLUB don't appear to have this problem. Of course,
they have per-CPU fastpath queues, so _can_ have effectively
exactly the same ordering issue if the object was brought
back into the "initialized" state before being freed, rather
than by ->ctor(). However in that case, it is at least
kind of visible to the caller.

Anyone care or think it is a problem? Should we just document
that ->ctor doesn't imply any barriers? Better ideas?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2008-10-17 20:29 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-15 16:34 [rfc] SLOB memory ordering issue Nick Piggin
2008-10-15 16:46 ` Nick Piggin
2008-10-15 16:54 ` Matt Mackall
2008-10-15 17:10   ` Nick Piggin
2008-10-15 17:33     ` Linus Torvalds
2008-10-15 17:36       ` Linus Torvalds
2008-10-15 17:58         ` Matt Mackall
2008-10-15 17:45       ` Nick Piggin
2008-10-15 18:03         ` Linus Torvalds
2008-10-15 18:12           ` Nick Piggin
2008-10-15 18:19             ` Matt Mackall
2008-10-15 18:35               ` Nick Piggin
2008-10-15 18:43                 ` Linus Torvalds
2008-10-15 19:19                   ` Nick Piggin
2008-10-15 19:47                     ` Linus Torvalds
2008-10-15 18:29             ` Linus Torvalds
2008-10-15 18:06     ` Nick Piggin
2008-10-15 18:26       ` Linus Torvalds
2008-10-15 18:50         ` Nick Piggin
2008-10-17 20:29       ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox