Skip to content

Commit

Permalink
8213927: G1 ignores AlwaysPreTouch when UseTransparentHugePages is en…
Browse files Browse the repository at this point in the history
…abled

With UseTransparentHugePages we always need to pretouch on small page size as the underlying memory could currently be allocated as either small or large pages.

Backport-of: fc87959
  • Loading branch information
Amos Shi authored and GoeLin committed Dec 15, 2023
1 parent 0c9de02 commit 4543378
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
Expand Up @@ -232,14 +232,19 @@ class G1PretouchTask : public AbstractGangTask {
char* volatile _cur_addr;
char* const _start_addr;
char* const _end_addr;
size_t const _page_size;
size_t _page_size;
public:
G1PretouchTask(char* start_address, char* end_address, size_t page_size) :
AbstractGangTask("G1 PreTouch"),
_cur_addr(start_address),
_start_addr(start_address),
_end_addr(end_address),
_page_size(page_size) {
_page_size(0) {
#ifdef LINUX
_page_size = UseTransparentHugePages ? (size_t)os::vm_page_size(): page_size;
#else
_page_size = page_size;
#endif
}

virtual void work(uint worker_id) {
Expand Down

1 comment on commit 4543378

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.