PPC: perf enhancement: Use larger heap page size on PPC.

Revisit of https://codereview.chromium.org/910333004.

Use 4MB heap page size over the default of 1MB.

This change provides an improvement of 1.86% on the composite octane
benchmark score on PPC. This is 0.56% more than if --min_semi_space_size=4
was used to specify a 4MB heap page size.

Additionally, two more tests required modification to account for
configurable heap page size.

R=svenpanne@chromium.org, hpayer@chromium.org, danno@chromium.org, mbrandy@us.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1221433022

Cr-Commit-Position: refs/heads/master@{#29775}
This commit is contained in:
dstence 2015-07-21 08:52:02 -07:00 committed by Commit bot
parent 1b616a682f
commit bb3bb6b773
4 changed files with 28 additions and 13 deletions

View File

@ -177,6 +177,11 @@
// Number of bits to represent the page size for paged spaces. The value of 20
// gives 1Mb bytes per page.
#if V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
// Bump up for Power Linux due to larger (64K) page size.
const int kPageSizeBits = 22;
#else
const int kPageSizeBits = 20;
#endif
#endif // V8_BASE_BUILD_CONFIG_H_

View File

@ -169,7 +169,7 @@ Heap::Heap()
#endif
// Ensure old_generation_size_ is a multiple of kPageSize.
DCHECK(MB >= Page::kPageSize);
DCHECK((max_old_generation_size_ & (Page::kPageSize - 1)) == 0);
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
set_native_contexts_list(NULL);
@ -5367,6 +5367,13 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB;
}
if (Page::kPageSize > MB) {
max_semi_space_size_ = ROUND_UP(max_semi_space_size_, Page::kPageSize);
max_old_generation_size_ =
ROUND_UP(max_old_generation_size_, Page::kPageSize);
max_executable_size_ = ROUND_UP(max_executable_size_, Page::kPageSize);
}
if (FLAG_stress_compaction) {
// This will cause more frequent GCs when stressing.
max_semi_space_size_ = Page::kPageSize;
@ -5392,12 +5399,6 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
reserved_semispace_size_ = max_semi_space_size_;
}
// The max executable size must be less than or equal to the max old
// generation size.
if (max_executable_size_ > max_old_generation_size_) {
max_executable_size_ = max_old_generation_size_;
}
// The new space size must be a power of two to support single-bit testing
// for containment.
max_semi_space_size_ =
@ -5416,7 +5417,8 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_semi_space_size_ / MB);
}
} else {
initial_semispace_size_ = initial_semispace_size;
initial_semispace_size_ =
ROUND_UP(initial_semispace_size, Page::kPageSize);
}
}
@ -5441,7 +5443,7 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_semi_space_size_ / MB);
}
} else {
target_semispace_size_ = target_semispace_size;
target_semispace_size_ = ROUND_UP(target_semispace_size, Page::kPageSize);
}
}
@ -5457,6 +5459,12 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize),
max_old_generation_size_);
// The max executable size must be less than or equal to the max old
// generation size.
if (max_executable_size_ > max_old_generation_size_) {
max_executable_size_ = max_old_generation_size_;
}
if (FLAG_initial_old_space_size > 0) {
initial_old_generation_size_ = FLAG_initial_old_space_size * MB;
} else {

View File

@ -17263,10 +17263,12 @@ class InitDefaultIsolateThread : public v8::base::Thread {
void Run() {
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
const intptr_t pageSizeMult =
v8::internal::Page::kPageSize / v8::internal::MB;
switch (testCase_) {
case SetResourceConstraints: {
create_params.constraints.set_max_semi_space_size(1);
create_params.constraints.set_max_old_space_size(4);
create_params.constraints.set_max_semi_space_size(1 * pageSizeMult);
create_params.constraints.set_max_old_space_size(4 * pageSizeMult);
break;
}
default:

View File

@ -1210,8 +1210,8 @@ TEST(SliceFromSlice) {
UNINITIALIZED_TEST(OneByteArrayJoin) {
v8::Isolate::CreateParams create_params;
// Set heap limits.
create_params.constraints.set_max_semi_space_size(1);
create_params.constraints.set_max_old_space_size(6);
create_params.constraints.set_max_semi_space_size(1 * Page::kPageSize / MB);
create_params.constraints.set_max_old_space_size(6 * Page::kPageSize / MB);
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
isolate->Enter();