From 7af6c06cde7c10c1a547c6cd52d1b70ca3ba77c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 28 Nov 2022 22:30:40 +0100 Subject: [PATCH] Add upstream patch to improve performance on some type-cast operations --- ...3-yescrypt_platform_cast_performance.patch | 23 +++++++++++++++++++ libxcrypt.spec | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch diff --git a/libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch b/libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch new file mode 100644 index 0000000..c79f5e0 --- /dev/null +++ b/libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch @@ -0,0 +1,23 @@ +From 9d5e7b7307f264c2d177a1f014fa3a3b9da524df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Sun, 20 Nov 2022 09:57:15 +0100 +Subject: [PATCH] alg-yescrypt-platform.c: Optimize some cast operation for + performance. + +--- + lib/alg-yescrypt-platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/alg-yescrypt-platform.c b/lib/alg-yescrypt-platform.c +index d68af2d..fbad1dc 100644 +--- a/lib/alg-yescrypt-platform.c ++++ b/lib/alg-yescrypt-platform.c +@@ -59,7 +59,7 @@ static void *alloc_region(yescrypt_region_t *region, size_t size) + if (base != MAP_FAILED) { + base_size = new_size; + } else if (flags & MAP_HUGETLB) { +- flags &= (unsigned int)~(MAP_HUGETLB | MAP_HUGE_2MB); ++ flags &= ~(unsigned int)(MAP_HUGETLB | MAP_HUGE_2MB); + base = mmap(NULL, size, PROT_READ | PROT_WRITE, (int)flags, -1, 0); + } + diff --git a/libxcrypt.spec b/libxcrypt.spec index e9811b0..5abee57 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -175,6 +175,7 @@ Source2: %{url}/releases/download/v%{version}/%{name}-gpgkey.gpg Source3: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.xz.sha256sum # Patch 0000 - 2999: Backported patches from upstream. +Patch0000: %{url}/commit/9d5e7b7307f2.patch#/%{name}-4.4.33-yescrypt_platform_cast_performance.patch # Patch 3000 - 5999: Backported patches from pull requests. @@ -577,6 +578,7 @@ done %changelog * Mon Nov 28 2022 Björn Esser - 4.4.33-3 - Convert License to SPDX expression +- Add upstream patch to improve performance on some type-cast operations * Mon Nov 21 2022 Björn Esser - 4.4.33-2 - Do not BR the compat package during bootstrap