[patch 13/13] syslets: x86: optimized sys_umem_add()



From: Ingo Molnar <mingo@xxxxxxx>

provide an optimized assembly version of sys_umem_add().
It is about 2 times faster than the C version.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
---
arch/i386/lib/getuser.S | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Index: linux/arch/i386/lib/getuser.S
===================================================================
--- linux.orig/arch/i386/lib/getuser.S
+++ linux/arch/i386/lib/getuser.S
@@ -11,6 +11,33 @@
#include <asm/thread_info.h>

/*
+ * Optimized user-memory arithmetics system-call:
+ */
+
+.text
+.align 4
+.globl sys_umem_add
+sys_umem_add:
+ movl 0x4(%esp), %ecx # uptr
+ movl 0x8(%esp), %edx # inc
+
+ cmpl $__PAGE_OFFSET, %ecx # access_ok(uptr)
+ jae bad_sys_umem_add
+
+1: addl %edx, (%ecx) # *uptr += inc
+2: movl (%ecx), %eax # return *uptr
+ ret
+
+bad_sys_umem_add:
+ movl $-14, %eax
+ ret
+
+.section __ex_table,"a"
+ .long 1b, bad_sys_umem_add
+ .long 2b, bad_sys_umem_add
+.previous
+
+/*
* copy_uatom() - copy a syslet_atom from user-space into kernel-space:
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH, RESEND] microblaze: Fix level interrupt ACKing
    ... If system clock runs at double-speed, then I should be able able to see that time is two times faster. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [patch 11/11] syslets: x86: optimized sys_umem_add()
    ... It is about 2 times faster than the C version. ... +.globl sys_umem_add ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [patch 14/14] syslets: x86: optimized sys_umem_add()
    ... It is about 2 times faster than the C version. ... +.globl sys_umem_add ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [patch 13/14] syslets: x86: optimized copy_uatom()
    ... This is about 3 times faster than the C version. ... +.globl copy_uatom ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [patch 12/13] syslets: x86: optimized copy_uatom()
    ... This is about 3 times faster than the C version. ... +.globl copy_uatom ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)