Skip to content

Currently used jhash are slow enough and replace it allow as to make KSM

Timofey Titovets linux-mm 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 1 replyIn review
  2. v6 posting 3/32 patches 20 repliesSuperseded
  3. v6 posting 2/32 patches 0 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v6 posting 1/32 patches1 replySuperseded
v52 patches1 replySuperseded
v32 patches0 repliesSuperseded
v2 posting 2/22 patches0 repliesSuperseded
v2 posting 1/22 patches2 repliesSuperseded
v11 patch6 repliesSuperseded

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xxHash: create arch dependent 32/64-bit xxhash()include/linux/xxhash.h+23 -01 reply
2/2ksm: replace jhash2 with xxhashmm/Kconfig mm/ksm.c+3 -20 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchPavel TatashinMike Rapoport
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH RESEND V8 0/2] Currently used jhash are slow enough and replace it allow as to make KSM

From: Timofey Titovets <[email protected]>

About speed (in kernel):

        ksm: crc32c   hash() 12081 MB/s
        ksm: xxh64    hash()  8770 MB/s
        ksm: xxh32    hash()  4529 MB/s
        ksm: jhash2   hash()  1569 MB/s

By sioh Lee tests (copy from other mail):
Test platform: openstack cloud platform (NEWTON version)
Experiment node: openstack based cloud compute node (CPU: xeon E5-2620 v3, memory 64gb)
VM: (2 VCPU, RAM 4GB, DISK 20GB) * 4
Linux kernel: 4.14 (latest version)
KSM setup - sleep_millisecs: 200ms, pages_to_scan: 200

Experiment process
Firstly, we turn off KSM and launch 4 VMs.
Then we turn on the KSM and measure the checksum computation time until full_scans become two.

The experimental results (the experimental value is the average of the measured values)
crc32c_intel: 1084.10ns
crc32c (no hardware acceleration): 7012.51ns
xxhash32: 2227.75ns
xxhash64: 1413.16ns
jhash2: 5128.30ns

In summary, the result shows that crc32c_intel has advantages over all of the hash function used in the experiment. (decreased by 84.54% compared to crc32c, 78.86% compared to jhash2, 51.33% xxhash32, 23.28% compared to xxhash64) the results are similar to those of Timofey.

But,
use only xxhash for now, because for using crc32c, cryptoapi must be initialized first - that require some tricky solution to work good in all situations.

So:
- Fisrt patch implement compile time pickup of fastest implementation of xxhash for target platform.
- Second replace jhash2 with xxhash

Thanks.

Timofey Titovets (2):
xxHash: create arch dependent 32/64-bit xxhash()
ksm: replace jhash2 with xxhash

 include/linux/xxhash.h | 23 +++++++++++++++++++++++
 mm/Kconfig             |  1 +
 mm/ksm.c               |  4 ++--
 3 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
2.19.0