<div dir="ltr">The only difference between v2 and v1 is <span style="font-size:12.8px">Tested-by: Laurent Dufour ... line.</span></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-08 23:10 GMT+03:00 Eugene Batalov <span dir="ltr"><<a href="mailto:eabatalov89@gmail.com" target="_blank">eabatalov89@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Before this patch vma sizes were hardcoded and weren't derived<br>
from PAGE_SIZE value.<br>
But all the actions with these vmas are based on PAGE_SIZE value.<br>
That's why maps008 on PowerPC with "huge" PAGE_SIZE of 64k was simply<br>
terminating due to invalid memory access.<br>
<br>
This commit sets vma sizes to safe values derived from PAGE_SIZE.<br>
New sizes are enough to perform all the actions test does with vmas.<br>
<br>
</span>Tested-by: Laurent Dufour <<a href="mailto:ldufour@linux.vnet.ibm.com">ldufour@linux.vnet.ibm.com</a>><br>
<div class="HOEnZb"><div class="h5">Signed-off-by: Eugene Batalov <<a href="mailto:eabatalov89@gmail.com">eabatalov89@gmail.com</a>><br>
---<br>
test/zdtm/transition/maps008.c | 22 ++++++++++++++++------<br>
1 file changed, 16 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/test/zdtm/transition/<wbr>maps008.c b/test/zdtm/transition/<wbr>maps008.c<br>
index b05ee7f..4a3e2a5 100644<br>
--- a/test/zdtm/transition/<wbr>maps008.c<br>
+++ b/test/zdtm/transition/<wbr>maps008.c<br>
@@ -195,9 +195,7 @@ struct test_sync {<br>
};<br>
struct test_sync *test_sync;<br>
<br>
-size_t mem1_size = 1L << 20;<br>
-size_t mem2_size = 1L << 21;<br>
-size_t mem3_size = 1L << 22;<br>
+size_t mem1_size, mem2_size, mem3_size;<br>
uint8_t *mem1, *mem2, *mem3;<br>
<br>
#define CRC_EPOCH_OFFSET (PAGE_SIZE - sizeof(uint32_t))<br>
@@ -288,8 +286,8 @@ static int proc131_func(task_waiter_t *setup_waiter)<br>
<br>
static int proc13_func(task_waiter_t *setup_waiter)<br>
{<br>
- size_t MEM1_HOLE_START = 10 * MEM_PERIOD;<br>
- size_t MEM1_HOLE_SIZE = 3 * MEM_PERIOD;<br>
+ size_t MEM1_HOLE_START = 2 * MEM_PERIOD;<br>
+ size_t MEM1_HOLE_SIZE = 1 * MEM_PERIOD;<br>
uint32_t crc_epoch = 0;<br>
<br>
pstree->proc13 = getpid();<br>
@@ -376,7 +374,7 @@ static int proc112_func(task_waiter_t *setup_waiter)<br>
<br>
static int proc11_func(task_waiter_t *setup_waiter)<br>
{<br>
- const size_t MEM3_START_CUT = 5 * MEM_PERIOD;<br>
+ const size_t MEM3_START_CUT = 1 * MEM_PERIOD;<br>
const size_t MEM3_END_CUT = 2 * MEM_PERIOD;<br>
void *mem3_old = mem3;<br>
size_t mem3_size_old = mem3_size;<br>
@@ -425,11 +423,23 @@ static int proc11_func(task_waiter_t *setup_waiter)<br>
return 0;<br>
}<br>
<br>
+#define MAX(a, b) ((a) > (b) ? (a) : (b))<br>
+#define MB(n) ((n) * (1UL << 20))<br>
+<br>
static int proc1_func(void)<br>
{<br>
uint32_t crc_epoch = 0;<br>
uint8_t *mem2_old = NULL;<br>
<br>
+ /*<br>
+ * Min mem size:<br>
+ * At least 5 mem periods for mem pages and vma holes.<br>
+ * At least 1 MB mem size not to test on tiny working set.<br>
+ */<br>
+ mem1_size = MEM_PERIOD * MAX(5, MB(1) / MEM_PERIOD + 1);<br>
+ mem2_size = mem1_size * 2;<br>
+ mem3_size = mem2_size * 3;<br>
+<br>
futex_set(&test_sync->datagen, 1);<br>
pstree->proc1 = getpid();<br>
mem1 = mmap_ashmem(mem1_size);<br>
--<br>
1.9.1<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Best regards,<br>Eugene Batalov.</div>
</div>