Re: Async suspend-resume patch w/ completions (was: Re: Async suspend-resume patch w/ rwsems)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Wednesday, December 9, 2009 - 7:51 pm

On Thu, 10 Dec 2009, Rafael J. Wysocki wrote:

What was so hard with the "Try the simple one first" to understand? You 
had a simpler working patch, why are you making this more complex one 
without ever having had any problems with the simpler one?

Btw, your 'atomic_set()' with errors is pure voodoo programming. That's 
not how atomics work. They do SMP-atomic addition etc, the 'atomic_set()' 
and 'atomic_read()' things are not in any way more atomic than any other 
access.

They are meant for racy reads (atomic_read()) and for initializations 
(atomic_set()), and the way you use them that 'atomic' part is entirely 
pointless, because it really isn't anything different from an 'int', 
except that it may be very very expensive on some architectures due to 
hashed spinlocks etc.

So stop this overdesign thing. Start simple. If you _ever_ see real 
problems, that's when you add stuff. As it is, any time you add 
complexity, you just add bugs.




And this, for example, is pretty disgusting. Not only is that 
INIT_COMPLETION purely brought on by the whole problem with completions 
(they are fundamentally one-shot, but you want to use them over and over 
so you need to re-initialize them: a nice lock wouldn't have that problem 
to begin with), but the comment isn't even accurate. Sure, it waits for 
any async jobs, but that's the _least_ of what the function actually does, 
so the comment is actively misleading, isn't it?

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

Messages in current thread:
Async suspend-resume patch w/ completions (was: Re: Async ..., Rafael J. Wysocki, (Wed Dec 9, 4:18 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Linus Torvalds, (Wed Dec 9, 7:51 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Thu Dec 10, 12:40 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Thu Dec 10, 6:02 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Fri Dec 11, 3:11 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Fri Dec 11, 4:48 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 12, 10:48 am)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 12, 3:34 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 12, 3:40 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sun Dec 13, 6:08 am)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Mon Dec 14, 3:11 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Mon Dec 14, 4:18 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Tue Dec 15, 4:03 am)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Tue Dec 15, 4:14 am)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Tue Dec 15, 7:11 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Wed Dec 16, 12:27 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Wed Dec 16, 2:57 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Wed Dec 16, 3:33 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Wed Dec 16, 6:49 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Thu Dec 17, 6:51 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Fri Dec 18, 3:43 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Fri Dec 18, 4:42 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 2:33 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 3:29 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 4:10 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 4:33 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 4:40 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 4:53 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 4:54 pm)
Re: Async suspend-resume patch w/ completions (was: Re: As ..., Rafael J. Wysocki, (Sat Dec 19, 5:35 pm)
Re: [linux-pm] Async suspend-resume patch w/ completions ( ..., Rafael J. Wysocki, (Sun Dec 20, 12:25 pm)