Re: [rfc] SLOB memory ordering issue

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Wednesday, October 15, 2008 - 10:36 am

On Wed, 15 Oct 2008, Linus Torvalds wrote:

Just to clarify a hopefully obvious issue..

The assumption here is that you don't protect things with locking. Of 
course, if all people accessing the new pointer always have the 
appropriate lock, then memory ordering never matters, since the locks take 
care of it.

So _most_ allocators obviously don't need to do any smp_wmb() at all. But 
the ones that expose things locklessly (where page tables are just one 
example) need to worry.

Again, this is yet another reason to not put things in the allocator. The 
allocator cannot know, and shouldn't care. For all the exact same reasons 
that the allocator cannot know and shouldn't care whether the ctor results 
in a 'final' version or whether the allocator will do some final fixups.

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 9:34 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 9:46 am)
Re: [rfc] SLOB memory ordering issue, Matt Mackall, (Wed Oct 15, 9:54 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 10:10 am)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 10:33 am)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 10:36 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 10:45 am)
Re: [rfc] SLOB memory ordering issue, Matt Mackall, (Wed Oct 15, 10:58 am)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 11:03 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 11:06 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 11:12 am)
Re: [rfc] SLOB memory ordering issue, Matt Mackall, (Wed Oct 15, 11:19 am)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 11:26 am)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 11:29 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 11:35 am)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 11:43 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 11:50 am)
Re: [rfc] SLOB memory ordering issue, Nick Piggin, (Wed Oct 15, 12:19 pm)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Wed Oct 15, 12:47 pm)
Re: [rfc] SLOB memory ordering issue, Linus Torvalds, (Fri Oct 17, 1:29 pm)