8259380: Correct pretouch chunk size to cap with actual page size
Reviewed-by: tschatzl, sjohanss
This commit is contained in:
parent
28ff2de186
commit
67e1b639ba
@ -64,13 +64,14 @@ void PretouchTask::work(uint worker_id) {
|
||||
|
||||
void PretouchTask::pretouch(const char* task_name, char* start_address, char* end_address,
|
||||
size_t page_size, WorkGang* pretouch_gang) {
|
||||
|
||||
// Chunk size should be at least (unmodified) page size as using multiple threads
|
||||
// pretouch on a single page can decrease performance.
|
||||
size_t chunk_size = MAX2(PretouchTask::chunk_size(), page_size);
|
||||
#ifdef LINUX
|
||||
// When using THP we need to always pre-touch using small pages as the OS will
|
||||
// initially always use small pages.
|
||||
page_size = UseTransparentHugePages ? (size_t)os::vm_page_size() : page_size;
|
||||
#endif
|
||||
size_t chunk_size = MAX2(PretouchTask::chunk_size(), page_size);
|
||||
|
||||
PretouchTask task(task_name, start_address, end_address, page_size, chunk_size);
|
||||
size_t total_bytes = pointer_delta(end_address, start_address, sizeof(char));
|
||||
|
Loading…
Reference in New Issue
Block a user