lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1506329174-19265-3-git-send-email-imbrenda@linux.vnet.ibm.com>
Date:   Mon, 25 Sep 2017 10:46:14 +0200
From:   Claudio Imbrenda <imbrenda@...ux.vnet.ibm.com>
To:     linux-kernel@...r.kernel.org
Cc:     borntraeger@...ibm.com, kvm@...r.kernel.org, linux-mm@...ck.org,
        nefelim4ag@...il.com, akpm@...ux-foundation.org,
        aarcange@...hat.com, mingo@...nel.org, zhongjiang@...wei.com,
        kirill.shutemov@...ux.intel.com, arvind.yadav.cs@...il.com,
        solee@...korea.ac.kr, ak@...ux.intel.com
Subject: [RFC v1 2/2] VS1544 KSM s390-specific memory comparison functions

Introduce s390 specific page comparison and checksumming functions:

The s390-specific functions use the CKSM instruction to quickly
calculate the checksum of a page.

This provides a measurable reduction on CPU load when KSM is active.

Signed-off-by: Claudio Imbrenda <imbrenda@...ux.vnet.ibm.com>
---
 arch/s390/include/asm/Kbuild        |  1 -
 arch/s390/include/asm/page_memops.h | 18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 arch/s390/include/asm/page_memops.h

diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index e68b429..b3c8847 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -14,7 +14,6 @@ generic-y += local.h
 generic-y += local64.h
 generic-y += mcs_spinlock.h
 generic-y += mm-arch-hooks.h
-generic-y += page_memops.h
 generic-y += preempt.h
 generic-y += trace_clock.h
 generic-y += word-at-a-time.h
diff --git a/arch/s390/include/asm/page_memops.h b/arch/s390/include/asm/page_memops.h
new file mode 100644
index 0000000..48b829b
--- /dev/null
+++ b/arch/s390/include/asm/page_memops.h
@@ -0,0 +1,18 @@
+#ifndef _ASM_S390_PAGE_MEMOPS_H
+#define _ASM_S390_PAGE_MEMOPS_H
+
+#include <linux/mm_types.h>
+#include <linux/highmem.h>
+#include <asm/checksum.h>
+
+static inline u32 calc_page_checksum(struct page *page)
+{
+	return csum_partial(page_address(page), PAGE_SIZE, 0);
+}
+
+static inline int memcmp_pages(struct page *page1, struct page *page2)
+{
+	return memcmp(page_address(page1), page_address(page2), PAGE_SIZE);
+}
+
+#endif
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ