From: Ingo Molnar <mingo@elte.hu>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Arjan van de Ven <arjan@infradead.org>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@zip.com.au>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Ulrich Drepper <drepper@redhat.com>,
Zach Brown <zach.brown@oracle.com>,
Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
"David S. Miller" <davem@davemloft.net>,
Benjamin LaHaise <bcrl@kvack.org>,
Suparna Bhattacharya <suparna@in.ibm.com>,
Davide Libenzi <davidel@xmailserver.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [patch 11/11] syslets: x86: optimized sys_umem_add()
Date: Tue, 13 Feb 2007 15:21:33 +0100 [thread overview]
Message-ID: <20070213142133.GL638@elte.hu> (raw)
From: Ingo Molnar <mingo@elte.hu>
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@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
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:
*/
reply other threads:[~2007-02-13 14:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070213142133.GL638@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@zip.com.au \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=bcrl@kvack.org \
--cc=davem@davemloft.net \
--cc=davidel@xmailserver.org \
--cc=drepper@redhat.com \
--cc=hch@infradead.org \
--cc=johnpol@2ka.mipt.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=suparna@in.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=zach.brown@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox