|
|
7f92c5 |
commit f008e0d18a4ba8ac26b67c5989efde3406bce535
|
|
|
7f92c5 |
Author: Jan Stancek <jstancek@redhat.com>
|
|
|
7f92c5 |
Date: Fri Dec 5 13:57:04 2014 +0100
|
|
|
7f92c5 |
|
|
|
7f92c5 |
lower mmap size of map_high_truncate_2 on 32bit s390
|
|
|
7f92c5 |
|
|
|
7f92c5 |
The low and high limit passed to vm_unmapped_area() in
|
|
|
7f92c5 |
hugetlb_get_unmapped_area() is (TASK_UNMAPPED_BASE, TASK_SIZE).
|
|
|
7f92c5 |
|
|
|
7f92c5 |
On 64-bit kernel this is defined as:
|
|
|
7f92c5 |
#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
|
|
|
7f92c5 |
(1UL << 30) : (1UL << 41))
|
|
|
7f92c5 |
#define TASK_SIZE_OF(tsk) ((tsk)->mm->context.asce_limit)
|
|
|
7f92c5 |
|
|
|
7f92c5 |
For 32-bit (-m31) process, this can be as small as
|
|
|
7f92c5 |
(0x40000000, 0x80000000), which is 0x40000000 bytes long area.
|
|
|
7f92c5 |
This testcase however is trying to allocate 0x60000000 and fails:
|
|
|
7f92c5 |
FAIL mmap() 1: Cannot allocate memory
|
|
|
7f92c5 |
|
|
|
7f92c5 |
Lower mmap size to ~0x20000000, which is more likely to suit
|
|
|
7f92c5 |
address space constraints of 32-bit s390.
|
|
|
7f92c5 |
|
|
|
7f92c5 |
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
|
7f92c5 |
Signed-off-by: Eric B Munson <emunson@mgebm.net>
|
|
|
7f92c5 |
|
|
|
7f92c5 |
diff --git a/tests/map_high_truncate_2.c b/tests/map_high_truncate_2.c
|
|
|
7f92c5 |
index daabd00..2a2560b 100644
|
|
|
7f92c5 |
--- a/tests/map_high_truncate_2.c
|
|
|
7f92c5 |
+++ b/tests/map_high_truncate_2.c
|
|
|
7f92c5 |
@@ -50,7 +50,11 @@
|
|
|
7f92c5 |
* 856fc29505556cf263f3dcda2533cf3766c14ab6.
|
|
|
7f92c5 |
*/
|
|
|
7f92c5 |
#define MAP_LENGTH (4 * hpage_size)
|
|
|
7f92c5 |
-#define TRUNCATE_POINT 0x60000000UL
|
|
|
7f92c5 |
+#if defined(__s390__) && __WORDSIZE == 32
|
|
|
7f92c5 |
+#define TRUNCATE_POINT 0x20000000UL
|
|
|
7f92c5 |
+#else
|
|
|
7f92c5 |
+#define TRUNCATE_POINT 0x60000000UL
|
|
|
7f92c5 |
+#endif
|
|
|
7f92c5 |
#define HIGH_ADDR 0xa0000000UL
|
|
|
7f92c5 |
|
|
|
7f92c5 |
int main(int argc, char *argv[])
|