All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
@ 2015-04-15  9:51 ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2015-04-15  9:51 UTC (permalink / raw)
  To: intel-gfx; +Cc: x86, linux-kernel, Ingo Molnar, H. Peter Anvin, Thomas Gleixner

For fixed sized copies, copy_to_user() will utilize __put_user_size
fastpaths. However, it is missing the translation for 64bit copies on
x86/32. Testing on a Pinetrail Atom, the 64 bit put_user fastpath is
substantially faster than the generic copy_to_user() fallback.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/include/asm/uaccess_32.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
index 3c03a5de64d3..0ed5504c6060 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -59,6 +59,10 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
 			__put_user_size(*(u32 *)from, (u32 __user *)to,
 					4, ret, 4);
 			return ret;
+		case 8:
+			__put_user_size(*(u64 *)from, (u64 __user *)to,
+					8, ret, 8);
+			return ret;
 		}
 	}
 	return __copy_to_user_ll(to, from, n);
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
@ 2015-04-15  9:51 ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2015-04-15  9:51 UTC (permalink / raw)
  To: intel-gfx
  Cc: Chris Wilson, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-kernel

For fixed sized copies, copy_to_user() will utilize __put_user_size
fastpaths. However, it is missing the translation for 64bit copies on
x86/32. Testing on a Pinetrail Atom, the 64 bit put_user fastpath is
substantially faster than the generic copy_to_user() fallback.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/include/asm/uaccess_32.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
index 3c03a5de64d3..0ed5504c6060 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -59,6 +59,10 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
 			__put_user_size(*(u32 *)from, (u32 __user *)to,
 					4, ret, 4);
 			return ret;
+		case 8:
+			__put_user_size(*(u64 *)from, (u64 __user *)to,
+					8, ret, 8);
+			return ret;
 		}
 	}
 	return __copy_to_user_ll(to, from, n);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
  2015-04-15  9:51 ` Chris Wilson
  (?)
@ 2015-04-15 22:01 ` shuang.he
  -1 siblings, 0 replies; 7+ messages in thread
From: shuang.he @ 2015-04-15 22:01 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, chris

Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6197
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                                  276/276              276/276
ILK                 -1              302/302              301/302
SNB                                  318/318              318/318
IVB                                  341/341              341/341
BYT                                  287/287              287/287
HSW                                  395/395              395/395
BDW                                  318/318              318/318
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*ILK  igt@gem_fenced_exec_thrash@no-spare-fences-busy-interruptible      PASS(3)      DMESG_WARN(1)PASS(1)
(dmesg patch applied)drm:i915_hangcheck_elapsed[i915]]*ERROR*Hangcheck_timer_elapsed...bsd_ring_idle@Hangcheck timer elapsed... bsd ring idle
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
  2015-04-15  9:51 ` Chris Wilson
@ 2015-04-16  7:28   ` Ingo Molnar
  -1 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2015-04-16  7:28 UTC (permalink / raw)
  To: Chris Wilson
  Cc: intel-gfx, x86, linux-kernel, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner


* Chris Wilson <chris@chris-wilson.co.uk> wrote:

> For fixed sized copies, copy_to_user() will utilize __put_user_size
> fastpaths. However, it is missing the translation for 64bit copies on
> x86/32. Testing on a Pinetrail Atom, the 64 bit put_user fastpath is
> substantially faster than the generic copy_to_user() fallback.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> CC: linux-kernel@vger.kernel.org

The patch makes sense, but your Signed-off-by line is missing.

Thanks,

	Ingo
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
@ 2015-04-16  7:28   ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2015-04-16  7:28 UTC (permalink / raw)
  To: Chris Wilson
  Cc: intel-gfx, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-kernel


* Chris Wilson <chris@chris-wilson.co.uk> wrote:

> For fixed sized copies, copy_to_user() will utilize __put_user_size
> fastpaths. However, it is missing the translation for 64bit copies on
> x86/32. Testing on a Pinetrail Atom, the 64 bit put_user fastpath is
> substantially faster than the generic copy_to_user() fallback.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> CC: linux-kernel@vger.kernel.org

The patch makes sense, but your Signed-off-by line is missing.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
  2015-04-16  7:28   ` Ingo Molnar
  (?)
@ 2015-04-16  7:40   ` Chris Wilson
  -1 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2015-04-16  7:40 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: intel-gfx, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-kernel

On Thu, Apr 16, 2015 at 09:28:02AM +0200, Ingo Molnar wrote:
> 
> * Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > For fixed sized copies, copy_to_user() will utilize __put_user_size
> > fastpaths. However, it is missing the translation for 64bit copies on
> > x86/32. Testing on a Pinetrail Atom, the 64 bit put_user fastpath is
> > substantially faster than the generic copy_to_user() fallback.
> > 
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > Cc: x86@kernel.org
> > CC: linux-kernel@vger.kernel.org
> 
> The patch makes sense, but your Signed-off-by line is missing.

Sorry, totally forgot that when rewriting the changelog.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:x86/asm] x86/asm: Enable fast 32-bit put_user_64() for copy_to_user()
  2015-04-15  9:51 ` Chris Wilson
                   ` (2 preceding siblings ...)
  (?)
@ 2015-04-16 16:15 ` tip-bot for Chris Wilson
  -1 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Chris Wilson @ 2015-04-16 16:15 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, chris, linux-kernel, bp, hpa, tglx, torvalds

Commit-ID:  6a907738ab9840ca3d71c22cd28fba4cbae7f7ce
Gitweb:     http://git.kernel.org/tip/6a907738ab9840ca3d71c22cd28fba4cbae7f7ce
Author:     Chris Wilson <chris@chris-wilson.co.uk>
AuthorDate: Wed, 15 Apr 2015 10:51:26 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 16 Apr 2015 12:08:21 +0200

x86/asm: Enable fast 32-bit put_user_64() for copy_to_user()

For fixed sized copies, copy_to_user() will utilize
__put_user_size() fastpaths. However, it is missing the
translation for 64-bit copies on x86/32.

Testing on a Pinetrail Atom, the 64 bit put_user() fastpath
is substantially faster than the generic copy_to_user()
fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Link: http://lkml.kernel.org/r/1429091486-11443-1-git-send-email-chris@chris-wilson.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/uaccess_32.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
index 3c03a5d..0ed5504 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -59,6 +59,10 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
 			__put_user_size(*(u32 *)from, (u32 __user *)to,
 					4, ret, 4);
 			return ret;
+		case 8:
+			__put_user_size(*(u64 *)from, (u64 __user *)to,
+					8, ret, 8);
+			return ret;
 		}
 	}
 	return __copy_to_user_ll(to, from, n);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-16 16:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15  9:51 [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user Chris Wilson
2015-04-15  9:51 ` Chris Wilson
2015-04-15 22:01 ` shuang.he
2015-04-16  7:28 ` Ingo Molnar
2015-04-16  7:28   ` Ingo Molnar
2015-04-16  7:40   ` Chris Wilson
2015-04-16 16:15 ` [tip:x86/asm] x86/asm: Enable fast 32-bit put_user_64() for copy_to_user() tip-bot for Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.