From e6fb39aa6869fa5033b87c14a9826598679cb47d Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 7 Nov 2019 22:42:38 +0000 Subject: runtime: make the test addresses for pageAlloc smaller on 32-bit This change makes the test addresses start at 1 GiB instead of 2 GiB to support mips and mipsle, which only have 31-bit address spaces. It also changes some tests to use smaller offsets for the chunk index to avoid jumping too far ahead in the address space to support 31-bit address spaces. The tests don't require such large jumps for what they're testing anyway. Updates #35112. Fixes #35440. Change-Id: Ic68ff2b0a1f10ef37ac00d4bb5b910ddcdc76f2e Reviewed-on: https://go-review.googlesource.com/c/go/+/205938 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall Reviewed-by: Cherry Zhang --- src/runtime/mpagealloc_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/runtime/mpagealloc_test.go') diff --git a/src/runtime/mpagealloc_test.go b/src/runtime/mpagealloc_test.go index 454fafb501..9034f63064 100644 --- a/src/runtime/mpagealloc_test.go +++ b/src/runtime/mpagealloc_test.go @@ -279,24 +279,24 @@ func TestPageAllocAlloc(t *testing.T) { }, "NotContiguousPallocChunkPages*2": { before: map[ChunkIdx][]BitRange{ - BaseChunkIdx: {}, - BaseChunkIdx + 0x100: {}, - BaseChunkIdx + 0x101: {}, + BaseChunkIdx: {}, + BaseChunkIdx + 0x40: {}, + BaseChunkIdx + 0x41: {}, }, scav: map[ChunkIdx][]BitRange{ - BaseChunkIdx: {{0, PallocChunkPages}}, - BaseChunkIdx + 0x100: {}, - BaseChunkIdx + 0x101: {}, + BaseChunkIdx: {{0, PallocChunkPages}}, + BaseChunkIdx + 0x40: {}, + BaseChunkIdx + 0x41: {}, }, hits: []hit{ - {PallocChunkPages * 2, PageBase(BaseChunkIdx+0x100, 0), 0}, + {PallocChunkPages * 2, PageBase(BaseChunkIdx+0x40, 0), 0}, {21, PageBase(BaseChunkIdx, 0), 21 * PageSize}, {1, PageBase(BaseChunkIdx, 21), PageSize}, }, after: map[ChunkIdx][]BitRange{ - BaseChunkIdx: {{0, 22}}, - BaseChunkIdx + 0x100: {{0, PallocChunkPages}}, - BaseChunkIdx + 0x101: {{0, PallocChunkPages}}, + BaseChunkIdx: {{0, 22}}, + BaseChunkIdx + 0x40: {{0, PallocChunkPages}}, + BaseChunkIdx + 0x41: {{0, PallocChunkPages}}, }, }, "StraddlePallocChunkPages*2": { -- cgit v1.3