aboutsummaryrefslogtreecommitdiffstats
path: root/prog/rand.go
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@linux.ibm.com>2020-05-26 12:15:49 +1000
committerDmitry Vyukov <dvyukov@google.com>2020-06-12 05:54:26 +0200
commit819b58b09fc321c20a1d465e63643cff8a3f38f0 (patch)
treede25cdf63f7a32b1b2fd90c176b5aba6071ed6a0 /prog/rand.go
parentc6ec8ed9ced064dbe21ef57ca2b231a0e3a4ce86 (diff)
ppc64: Increase page size
The default configuration on PPC64 uses 64K system page size. Having it 4K was not a problem until recently when 365fba2440cee3aed74c77 "executor: surround the data mapping with PROT_NONE pages" added surrounding mappings not aligned to the actual system page size. This changes the page size for ppc64 to 64K and introduces the upper limit to randPageCount() as we have the hard coded limit of 16MB. If the unlikely event of a PPC64 system with 4K pages, we will end up allocating less pages which is not great but acceptable. This avoids using os.Getpagesize() as the page size on a building host may be different than on the test machine so we always use the bigger size for simplicity. Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
Diffstat (limited to 'prog/rand.go')
-rw-r--r--prog/rand.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/prog/rand.go b/prog/rand.go
index 7a035c1b2..a6c013fdd 100644
--- a/prog/rand.go
+++ b/prog/rand.go
@@ -175,7 +175,7 @@ func (r *randGen) randPageCount() (n uint64) {
case r.nOutOf(5, 6):
n = r.rand(20) + 1
default:
- n = (r.rand(3) + 1) * 512
+ n = (r.rand(3) + 1) * r.target.NumPages / 4
}
return
}