The strategy to find out TASK_SIZE won't work on s390x anymore, starting
with kernel 3.9. We will dynamically increase the pagetable levels on
s390x on access beyond TASK_SIZE, effectively increasing TASK_SIZE from
2^42 to 2^53, but /proc/self/maps won't reflect this.

With the current strategy that means that find_task_size() would loop
for a very long time, from 2^42 to 2^53. To fix this, increase addr
in the loop for s390x as soon as we exceed the 2^42 limit.

Signed-off-by: Gerald Schaefer <gerald.schae...@de.ibm.com>
---
 tests/task-size-overrun.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/task-size-overrun.c b/tests/task-size-overrun.c
index 0140277..0ab76c7 100644
--- a/tests/task-size-overrun.c
+++ b/tests/task-size-overrun.c
@@ -82,6 +82,10 @@ static unsigned long find_task_size(void)
                }
                munmap(p, getpagesize());
                addr += getpagesize();
+#if defined(__s390x__)
+               if (addr > (1UL << 42) && addr < (1UL << 53))
+                       addr = 1UL << 53;
+#endif
        }
        /* addr wrapped around */
        return 0;
-- 
1.7.12.4


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to