From: Mikulas Patocka <mpatocka@xxxxxxxxxx>
Date: Tue, 17 Jun 2008 20:47:57 -0400 (EDT)
Wait queue waking looks like being written by a high-level maniac --- it
contains 8 levels of calls (none of them inlined). 7 of these calls (until
try_to_wake_up) do nothing but pass arguments to lower level call. And
each of these calls allocate at least 192 bytes of stack space. All these
7 useless calls consume 1360 bytes of stack (and cause windows traps that
needlessly damage performance). Would you agree to inline most of the
calls to save stack? Or do you see another solution?
Some of them could be inlined but there are a few limiting
factors here.
Even spin lock acquisitions are function calls, limiting how
much leaf function and tail call optimizations can be done.
Also, wake_up_bit has this aggregate local variable "key" whose
address is passed down to subsequent functions, which limits
optimizations even further.
It could still be improved a lot, however.
But the level of recursion possible by the current device layer is
excessive and needs to be curtained irrespective of these generic
wakeup and sparc64 interrupt stack issues.