Messages in this thread | | | Date | Fri, 29 Oct 2004 14:03:19 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: Semaphore assembly-code bug |
| |
On Fri, 29 Oct 2004, Linus Torvalds wrote: > > Here's a totally untested patch to make the semaphores use "fastcall" > instead of "asmlinkage"
Ok, I tested it, looked through the assembly code, and did a general size comparison. Everything looks good, and it should fix the problem that caused this discussion. Checked in.
The patch actually improves code generation by moving the failure case argument generation _into_ the failure case: this makes the inline asm one instruction longer, but it means that the fastpath is often one instruction shorter. In fact, the fastpath is usually improved even _more_ than that, because gcc does sucketh at generating code that uses fixed registers (ie the old code often caused gcc to first generate the value into another register, and then _move_ it into %eax, rather than just generating it into %eax in the first place).
My test-kernel shrunk by a whopping 2kB in size from this change.
Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |