On Wed, 26 Oct 2016, Brian Boylston wrote:
@@ -196,6 +196,9 @@ static inline void *__memcpy3d(void *to, const void *from, size_t
+extern void *memcpy_nocache(void *dest, const void *src, size_t count);
Can we please move that prototype to linux/string.h instead of having it in
both files and just define __HAVE_ARCH_MEMCPY_NOCACHE? And that define can
move into x86/include/asm/string.h. There is no point in duplicating all
@@ -51,6 +51,9 @@ extern void *__memcpy(void *to, const void *from, size_t len);
+extern void *memcpy_nocache(void *dest, const void *src, size_t count)
You define __HAVE_ARCH_MEMCPY_NOCACHE for both 32 and 64 bit. What is
this #ifdef for ?
+void *memcpy_nocache(void *dest, const void *src, size_t count)
+ __copy_from_user_inatomic_nocache(dest, src, count);
You want to replace a memcpy with this and then use copy from user. Why?
That does not make any sense to me and even if it makes sense for whatever
reason then this wants to be documented and the src argument needs a type
cast to (void __user *)..
Further this uses the inatomic variant. Why? Does a memcpy replacement
suddenly require to be called in atomic context? Again, this makes no sense
and lacks any form of comment. The kernel doc below does not say anything
Neither provides the changelog any useful information which is
complementary to what the patch actually does.
+ * memcpy_nocache - Copy one area of memory to another, avoiding the
+ * processor cache if possible
I'm not sure whether kerneldoc is happy about that line break. Did you
build the docs?
Make the initial line shorter and explain the functionality in detail
below the arguments
+ * @dest: Where to copy to
+ * @src: Where to copy from
+ * @count: The size of the area.
Nit. Can you please make this in tabular form for readability sake?
* @dest: Where to copy to
* @src: Where to copy from
* @count: The size of the area.
+static inline void *memcpy_nocache(void *dest, const void *src, size_t count)
+ return memcpy(dest, src, count);