Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1679778 > unrolled thread
| Started by | Ingo Molnar <mingo@kernel.org> |
|---|---|
| First post | 2017-07-03 11:00 +0200 |
| Last post | 2017-07-04 00:00 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL] x86/asm changes for v4.13 Ingo Molnar <mingo@kernel.org> - 2017-07-03 11:00 +0200
Re: [GIT PULL] x86/asm changes for v4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-03 22:40 +0200
Re: [GIT PULL] x86/asm changes for v4.13 Ingo Molnar <mingo@kernel.org> - 2017-07-04 00:00 +0200
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2017-07-03 11:00 +0200 |
| Subject | [GIT PULL] x86/asm changes for v4.13 |
| Message-ID | <tZ5n3-78c-17@gated-at.bofh.it> |
Linus,
Please pull the latest x86-asm-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-asm-for-linus
# HEAD: 236222d39347e0e486010f10c1493e83dbbdfba8 x86/uaccess: Optimize copy_user_enhanced_fast_string() for short strings
A single commit micro-optimizing short string copies on certain Intel CPUs.
Thanks,
Ingo
------------------>
Paolo Abeni (1):
x86/uaccess: Optimize copy_user_enhanced_fast_string() for short strings
arch/x86/lib/copy_user_64.S | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index c5959576c315..020f75cc8cf6 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -37,7 +37,7 @@ ENTRY(copy_user_generic_unrolled)
movl %edx,%ecx
andl $63,%edx
shrl $6,%ecx
- jz 17f
+ jz .L_copy_short_string
1: movq (%rsi),%r8
2: movq 1*8(%rsi),%r9
3: movq 2*8(%rsi),%r10
@@ -58,7 +58,8 @@ ENTRY(copy_user_generic_unrolled)
leaq 64(%rdi),%rdi
decl %ecx
jnz 1b
-17: movl %edx,%ecx
+.L_copy_short_string:
+ movl %edx,%ecx
andl $7,%edx
shrl $3,%ecx
jz 20f
@@ -174,6 +175,8 @@ EXPORT_SYMBOL(copy_user_generic_string)
*/
ENTRY(copy_user_enhanced_fast_string)
ASM_STAC
+ cmpl $64,%edx
+ jb .L_copy_short_string /* less then 64 bytes, avoid the costly 'rep' */
movl %edx,%ecx
1: rep
movsb
[toc] | [next] | [standalone]
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Date | 2017-07-03 22:40 +0200 |
| Message-ID | <tZgiu-6Gt-11@gated-at.bofh.it> |
| In reply to | #1679778 |
On Mon, Jul 3, 2017 at 1:50 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> A single commit micro-optimizing short string copies on certain Intel CPUs.
That's slightly misleading - it's not string copies, it's just regular
user copies using the "fast string" interface.
Fixing that up in my merge commit message.
Linus
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2017-07-04 00:00 +0200 |
| Message-ID | <tZhxT-7nV-5@gated-at.bofh.it> |
| In reply to | #1680562 |
* Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Mon, Jul 3, 2017 at 1:50 AM, Ingo Molnar <mingo@kernel.org> wrote: > > > > A single commit micro-optimizing short string copies on certain Intel CPUs. > > That's slightly misleading - it's not string copies, it's just regular > user copies using the "fast string" interface. Indeed! > Fixing that up in my merge commit message. Thanks! Ingo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web