Skip to content

Commit

Permalink
8335865: Shenandoah: Improve THP pretouch after JDK-8315923
Browse files Browse the repository at this point in the history
  • Loading branch information
neethu-prasad committed Jul 19, 2024
1 parent 73e3e0e commit 736fff5
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,7 @@ jint ShenandoahHeap::initialize() {

// Reserve aux bitmap for use in object_iterate(). We don't commit it here.
size_t aux_bitmap_page_size = bitmap_page_size;
#ifdef LINUX
// In THP "advise" mode, we refrain from advising the system to use large pages
// since we know these commits will be short lived, and there is no reason to trash
// the THP area with this bitmap.
if (UseTransparentHugePages) {
aux_bitmap_page_size = os::vm_page_size();
}
#endif

ReservedSpace aux_bitmap(_bitmap_size, aux_bitmap_page_size);
os::trace_page_sizes_for_requested_size("Aux Bitmap",
bitmap_size_orig, aux_bitmap_page_size,
Expand Down Expand Up @@ -388,16 +381,6 @@ jint ShenandoahHeap::initialize() {
_pretouch_heap_page_size = heap_page_size;
_pretouch_bitmap_page_size = bitmap_page_size;

#ifdef LINUX
// UseTransparentHugePages would madvise that backing memory can be coalesced into huge
// pages. But, the kernel needs to know that every small page is used, in order to coalesce
// them into huge one. Therefore, we need to pretouch with smaller pages.
if (UseTransparentHugePages) {
_pretouch_heap_page_size = (size_t)os::vm_page_size();
_pretouch_bitmap_page_size = (size_t)os::vm_page_size();
}
#endif

// OS memory managers may want to coalesce back-to-back pages. Make their jobs
// simpler by pre-touching continuous spaces (heap and bitmap) separately.

Expand Down

0 comments on commit 736fff5

Please sign in to comment.