All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V6 0/2 RESEND] KSM replace hash algo with faster hash
@ 2018-04-18 19:32 Timofey Titovets
  2018-04-18 19:32 ` [PATCH V6 1/2 RESEND] xxHash: create arch dependent 32/64-bit xxhash() Timofey Titovets
  2018-04-18 19:32 ` [PATCH V6 2/2 RESEND] ksm: replace jhash2 with faster hash Timofey Titovets
  0 siblings, 2 replies; 27+ messages in thread
From: Timofey Titovets @ 2018-04-18 19:32 UTC (permalink / raw)
  To: linux-mm; +Cc: Timofey Titovets, Andrea Arcangeli, kvm, leesioh

From: Timofey Titovets <nefelim4ag@gmail.com>

Currently used jhash are slow enough and replace it allow as to make KSM
less cpu hungry.

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.

So:
  - Fisrt patch implement compile time pickup of fastest implementation of xxhash
    for target platform.
  - Second implement logic in ksm, what test speed of hashes and pickup fastest hash
  
Thanks.

CC: Andrea Arcangeli <aarcange@redhat.com>
CC: linux-mm@kvack.org
CC: kvm@vger.kernel.org
CC: leesioh <solee@os.korea.ac.kr>

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

 include/linux/xxhash.h | 23 +++++++++++++
 mm/Kconfig             |  2 ++
 mm/ksm.c               | 93 +++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 114 insertions(+), 4 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH V6 0/2 RESEND] KSM replace hash algo with faster hash
@ 2018-02-07 10:22 Timofey Titovets
  2018-02-07 10:22   ` Timofey Titovets
  0 siblings, 1 reply; 27+ messages in thread
From: Timofey Titovets @ 2018-02-07 10:22 UTC (permalink / raw)
  To: linux-mm; +Cc: Timofey Titovets, Andrea Arcangeli, kvm, leesioh

Currently used jhash are slow enough and replace it allow as to make KSM
less cpu hungry.

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.

So:
  - Fisrt patch implement compile time pickup of fastest implementation of xxhash
    for target platform.
  - Second implement logic in ksm, what test speed of hashes and pickup fastest hash
  
Thanks.

CC: Andrea Arcangeli <aarcange@redhat.com>
CC: linux-mm@kvack.org
CC: kvm@vger.kernel.org
CC: leesioh <solee@os.korea.ac.kr>

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

 include/linux/xxhash.h | 23 +++++++++++++
 mm/Kconfig             |  2 ++
 mm/ksm.c               | 93 +++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 114 insertions(+), 4 deletions(-)

-- 
2.14.1

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

end of thread, other threads:[~2018-09-13 18:11 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 19:32 [PATCH V6 0/2 RESEND] KSM replace hash algo with faster hash Timofey Titovets
2018-04-18 19:32 ` [PATCH V6 1/2 RESEND] xxHash: create arch dependent 32/64-bit xxhash() Timofey Titovets
2018-04-18 19:32 ` [PATCH V6 2/2 RESEND] ksm: replace jhash2 with faster hash Timofey Titovets
2018-05-08 15:26   ` Claudio Imbrenda
2018-05-11 23:06     ` Timofey Titovets
2018-05-14 10:17       ` Claudio Imbrenda
2018-05-16 10:26         ` Timofey Titovets
2018-05-22 20:22   ` Pavel Tatashin
2018-05-23 13:45     ` Timofey Titovets
2018-05-23 14:24       ` Pavel Tatashin
2018-05-24  8:01         ` Timofey Titovets
2018-05-25  1:16           ` Pavel Tatashin
2018-05-26 20:25             ` [PATCH] " kbuild test robot
2018-05-26 21:06             ` kbuild test robot
2018-05-27 13:03           ` [PATCH V6 2/2 RESEND] " Mike Rapoport
2018-05-29 14:45             ` Pavel Tatashin
2018-06-07  8:58               ` Timofey Titovets
2018-06-07 11:52                 ` Mike Rapoport
2018-06-08  1:29                   ` Pavel Tatashin
2018-06-10  5:38                     ` Mike Rapoport
2018-06-22 18:48                       ` Pavel Tatashin
2018-06-25  8:48                     ` Mike Rapoport
2018-09-13 10:35                       ` Timofey Titovets
2018-09-13 18:01                         ` Mike Rapoport
2018-09-13 18:10                           ` Pasha Tatashin
  -- strict thread matches above, loose matches on Subject: below --
2018-02-07 10:22 [PATCH V6 0/2 RESEND] KSM replace hash algo " Timofey Titovets
2018-02-07 10:22 ` [PATCH V6 2/2 RESEND] ksm: replace jhash2 " Timofey Titovets
2018-02-07 10:22   ` Timofey Titovets

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.