mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC 0/5] memset_l and memfill
@ 2017-03-08 20:24 Matthew Wilcox
  2017-03-08 20:24 ` [PATCH 1/5] Add memset_l(), memset32() and memset64() Matthew Wilcox
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthew Wilcox @ 2017-03-08 20:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Wilcox

From: Matthew Wilcox <mawilcox@microsoft.com>

zram was recently enhanced to support compressing pages with a repeating
pattern up to the size of an unsigned long.  As part of the discussion,
we noted it would be nice if architectures had optimised routines to
fill regions of memory with patterns larger than those contained in a
single byte.

The memfill() function exists as part of Lars Wirzenius' publib, but
it's not necessarily the most convenient interface to use.  So I offer
four interfaces as part of this patchset -- memset_l (long), memset32
(32-bit), memset64 (64-bit) and memfill (arbitrary length).

We have one user in this patchset for each of memset32() and memset_l().
Patches to convert more users would be welcome.  In particular, there
aren't any users for the generic memfill() yet.  Requests for memset_p
(pointer), memset16 and memset_s (short) would be interesting.  memset_ll
(long long), or other suggestions that would lead to compiling memset64()
on 32-bit would also be interesting.

I'd also like to see assembly language mavens produce optimised
memset32/memset64 implementations for their pet architecture.  I've
included my awful test-suite for your benefit; it did find a few bugs
in memfill() while I was getting the edge cases nailed down.

Matthew Wilcox (5):
  Add memset_l(), memset32() and memset64()
  zram: Convert to using memset_l()
  sym53c8xx_2: Convert to use memset32()
  Add memfill()
  Hacky testsuite for memfill() and memset_l()

 drivers/block/zram/zram_drv.c                 | 15 +----
 drivers/scsi/sym53c8xx_2/sym_hipd.c           | 11 +---
 include/linux/string.h                        | 16 +++++
 lib/string.c                                  | 85 +++++++++++++++++++++++++++
 tools/include/linux/compiler.h                |  5 ++
 tools/include/linux/string.h                  | 11 ++++
 tools/testing/radix-tree/asm/page.h           |  0
 tools/testing/radix-tree/asm/word-at-a-time.h |  1 +
 tools/testing/radix-tree/linux/ctype.h        |  0
 tools/testing/radix-tree/linux/kernel.h       |  2 +
 tools/testing/radix-tree/string.c             | 53 +++++++++++++++++
 11 files changed, 179 insertions(+), 20 deletions(-)
 create mode 100644 tools/testing/radix-tree/asm/page.h
 create mode 100644 tools/testing/radix-tree/asm/word-at-a-time.h
 create mode 100644 tools/testing/radix-tree/linux/ctype.h
 create mode 100644 tools/testing/radix-tree/string.c

-- 
2.11.0

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

end of thread, other threads:[~2017-03-08 22:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08 20:24 [RFC 0/5] memset_l and memfill Matthew Wilcox
2017-03-08 20:24 ` [PATCH 1/5] Add memset_l(), memset32() and memset64() Matthew Wilcox
2017-03-08 20:24 ` [PATCH 2/5] zram: Convert to using memset_l() Matthew Wilcox
2017-03-08 20:24 ` [PATCH 3/5] sym53c8xx_2: Convert to use memset32() Matthew Wilcox
2017-03-08 20:24 ` [PATCH 4/5] Add memfill() Matthew Wilcox
2017-03-08 20:24 ` [PATCH 5/5] Hacky testsuite for memfill() and memset_l() Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®