Matthew Wilcox 3b3c4babd8 lib/string.c: add multibyte memset functions
Patch series "Multibyte memset variations", v4.

A relatively common idiom we're missing is a function to fill an area of
memory with a pattern which is larger than a single byte.  I first
noticed this with a zram patch which wanted to fill a page with an
'unsigned long' value.  There turn out to be quite a few places in the
kernel which can benefit from using an optimised function rather than a
loop; sometimes text size, sometimes speed, and sometimes both.  The
optimised PowerPC version (not included here) improves performance by
about 30% on POWER8 on just the raw memset_l().

Most of the extra lines of code come from the three testcases I added.

This patch (of 8):

memset16(), memset32() and memset64() are like memset(), but allow the
caller to fill the destination with a value larger than a single byte.
memset_l() and memset_p() allow the caller to use unsigned long and
pointer values respectively.

Link: http://lkml.kernel.org/r/20170720184539.31609-2-willy@infradead.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: David Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-08 18:26:48 -07:00
..
2017-07-09 18:48:37 -07:00
2017-09-07 13:51:13 -07:00
2017-09-07 13:51:13 -07:00
2017-09-07 12:24:50 -07:00
2017-09-07 13:55:16 -07:00
2017-06-08 18:52:36 -07:00
2017-07-17 17:26:14 +02:00
2017-07-06 16:24:33 -07:00
2017-09-07 21:11:05 -07:00
2017-07-10 10:51:53 -07:00
2017-07-03 16:56:28 -06:00
2017-06-05 16:59:12 +02:00
2017-08-31 17:32:38 -04:00
2017-06-22 15:43:47 +01:00
2017-09-04 00:05:22 +02:00
2017-09-07 10:15:40 -07:00
2017-09-04 00:06:02 +02:00
2017-08-10 12:28:57 +02:00
2017-06-09 11:52:07 +02:00
2017-08-24 13:23:03 -07:00
2017-07-27 08:15:43 +10:00
2017-07-17 13:42:48 +02:00
2017-07-07 20:09:10 -04:00
2017-09-08 18:26:46 -07:00
2017-05-18 10:07:41 -04:00
2017-05-18 10:07:40 -04:00
2017-06-21 14:37:12 -04:00
2017-07-10 16:32:34 -07:00
2017-07-10 10:51:53 -07:00
2017-08-14 13:33:39 -07:00
2017-08-01 12:03:10 -07:00
2017-08-28 20:51:22 +02:00
2017-08-18 15:32:01 -07:00
2017-07-13 16:00:15 -04:00
2017-07-06 11:30:07 -04:00
2017-07-25 18:05:25 +02:00
2017-05-26 10:10:37 +02:00
2017-09-06 17:27:26 -07:00
2017-09-03 17:49:17 -07:00
2017-08-06 20:55:29 -07:00
2017-08-06 20:55:29 -07:00
2017-08-21 12:47:31 -07:00
2017-09-08 18:26:47 -07:00
2017-08-16 16:28:47 -07:00
2017-07-03 15:12:52 -07:00
2017-06-29 10:48:57 +01:00
2017-09-07 21:11:05 -07:00
2017-07-12 23:11:23 +02:00
2017-06-08 10:35:49 +02:00
2017-08-01 12:03:10 -07:00
2017-07-06 16:24:30 -07:00
2017-08-16 16:28:47 -07:00
2017-08-03 21:37:29 -07:00
2017-06-08 18:52:42 -07:00
2017-06-01 14:53:04 -04:00
2017-08-28 16:15:42 +02:00
2017-07-24 17:50:37 +02:00
2017-05-09 16:43:22 +03:00
2017-08-31 18:50:14 +02:00
2017-08-18 15:32:01 -07:00
2017-09-05 06:34:17 -07:00