Blame SOURCES/0004-tests-task-size-overrun-Make-test-faster-on-powerpc6.patch

fc9b0e
From 2f38664f81e1877f81b16ed327b540d69d175a5b Mon Sep 17 00:00:00 2001
fc9b0e
Message-Id: <2f38664f81e1877f81b16ed327b540d69d175a5b.1566225007.git.aquini@redhat.com>
fc9b0e
In-Reply-To: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
References: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
From: Sandipan Das <sandipan@linux.ibm.com>
fc9b0e
Date: Thu, 15 Aug 2019 13:08:31 +0530
fc9b0e
Subject: [RHEL7 PATCH 04/31] tests: task-size-overrun: Make test faster on
fc9b0e
 powerpc64
fc9b0e
fc9b0e
As of now, powerpc64 supports 64TB, 128TB, 512TB, 1PB, 2PB and
fc9b0e
4PB user address space sizes with 4TB being the default for the
fc9b0e
newer kernels. With the relatively conservative increments that
fc9b0e
this test uses to find the task size, it takes a very long time
fc9b0e
but this can be made faster by also increasing the increment
fc9b0e
factor in steps of the different supported task sizes.
fc9b0e
fc9b0e
Fixes: 02df38e ("Defined task size value to be 512T if it is more that 64Tb.")
fc9b0e
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
fc9b0e
Signed-off-by: Eric B Munson <emunson@mgebm.net>
fc9b0e
Signed-off-by: Rafael Aquini <aquini@redhat.com>
fc9b0e
---
fc9b0e
 tests/task-size-overrun.c | 14 ++++++++++++--
fc9b0e
 1 file changed, 12 insertions(+), 2 deletions(-)
fc9b0e
fc9b0e
diff --git a/tests/task-size-overrun.c b/tests/task-size-overrun.c
fc9b0e
index dc9ce0e..914ef65 100644
fc9b0e
--- a/tests/task-size-overrun.c
fc9b0e
+++ b/tests/task-size-overrun.c
fc9b0e
@@ -83,8 +83,18 @@ static unsigned long find_task_size(void)
fc9b0e
 		munmap(p, getpagesize());
fc9b0e
 		addr += getpagesize();
fc9b0e
 #if defined(__powerpc64__)
fc9b0e
-		if (addr > (1UL << 46) && addr < (1UL << 49))
fc9b0e
-			addr = 1UL << 49;
fc9b0e
+		if (addr > (1UL << 46) && addr < (1UL << 47))
fc9b0e
+			addr = 1UL << 47;	/* 64TB */
fc9b0e
+		else if (addr > (1UL << 47) && addr < (1UL << 48))
fc9b0e
+			addr = 1UL << 48;	/* 128TB */
fc9b0e
+		else if (addr > (1UL << 48) && addr < (1UL << 49))
fc9b0e
+			addr = 1UL << 49;	/* 512TB */
fc9b0e
+		else if (addr > (1UL << 49) && addr < (1UL << 50))
fc9b0e
+			addr = 1UL << 50;	/* 1PB */
fc9b0e
+		else if (addr > (1UL << 50) && addr < (1UL << 51))
fc9b0e
+			addr = 1UL << 51;	/* 2PB */
fc9b0e
+		else if (addr > (1UL << 51) && addr < (1UL << 52))
fc9b0e
+			addr = 1UL << 52;	/* 4PB */
fc9b0e
 #endif
fc9b0e
 #if defined(__s390x__)
fc9b0e
 		if (addr > (1UL << 42) && addr < (1UL << 53))
fc9b0e
-- 
fc9b0e
1.8.3.1
fc9b0e