|
|
fc9b0e |
From 65c07c0f64ef1c97f9aea80d0c8470417e377a6a Mon Sep 17 00:00:00 2001
|
|
|
fc9b0e |
Message-Id: <65c07c0f64ef1c97f9aea80d0c8470417e377a6a.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:33 +0530
|
|
|
fc9b0e |
Subject: [RHEL7 PATCH 06/31] tests: map-high-truncate-2: Skip if truncation
|
|
|
fc9b0e |
point is not aligned
|
|
|
fc9b0e |
|
|
|
fc9b0e |
Attempting ftruncate() on a hugetlbfs file descriptor requires
|
|
|
fc9b0e |
the truncation point to be aligned to the huge page size. So,
|
|
|
fc9b0e |
this test is not applicable for huge page sizes greater that
|
|
|
fc9b0e |
are either greater than or not a factor of the truncation point.
|
|
|
fc9b0e |
|
|
|
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/map_high_truncate_2.c | 7 +++++++
|
|
|
fc9b0e |
1 file changed, 7 insertions(+)
|
|
|
fc9b0e |
|
|
|
fc9b0e |
diff --git a/tests/map_high_truncate_2.c b/tests/map_high_truncate_2.c
|
|
|
fc9b0e |
index 2a2560b..fc44a13 100644
|
|
|
fc9b0e |
--- a/tests/map_high_truncate_2.c
|
|
|
fc9b0e |
+++ b/tests/map_high_truncate_2.c
|
|
|
fc9b0e |
@@ -56,6 +56,7 @@
|
|
|
fc9b0e |
#define TRUNCATE_POINT 0x60000000UL
|
|
|
fc9b0e |
#endif
|
|
|
fc9b0e |
#define HIGH_ADDR 0xa0000000UL
|
|
|
fc9b0e |
+#define FOURGIG ((off64_t)0x100000000ULL)
|
|
|
fc9b0e |
|
|
|
fc9b0e |
int main(int argc, char *argv[])
|
|
|
fc9b0e |
{
|
|
|
fc9b0e |
@@ -69,6 +70,12 @@ int main(int argc, char *argv[])
|
|
|
fc9b0e |
|
|
|
fc9b0e |
hpage_size = check_hugepagesize();
|
|
|
fc9b0e |
|
|
|
fc9b0e |
+ if (hpage_size > TRUNCATE_POINT)
|
|
|
fc9b0e |
+ CONFIG("Huge page size is too large");
|
|
|
fc9b0e |
+
|
|
|
fc9b0e |
+ if (TRUNCATE_POINT % hpage_size)
|
|
|
fc9b0e |
+ CONFIG("Truncation point is not aligned to huge page size");
|
|
|
fc9b0e |
+
|
|
|
fc9b0e |
check_free_huge_pages(4);
|
|
|
fc9b0e |
|
|
|
fc9b0e |
fd = hugetlbfs_unlinked_fd();
|
|
|
fc9b0e |
--
|
|
|
fc9b0e |
1.8.3.1
|
|
|
fc9b0e |
|