Skip to content

Commit a13dd29

Browse files
author
William Kemper
committed
8380390: Shenandoah: Missing store barrier when resetting bitmaps
Reviewed-by: ruili, xpeng, kdnilsen
1 parent 0c81774 commit a13dd29

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ class ShenandoahHeapRegion {
280280
// clears the self_fwd bits. Safety-net reset on region recycle.
281281
ShenandoahSharedFlag _has_self_forwards;
282282

283+
// This is only read/written by a gc worker to avoid unnecessary bitmap resets
283284
bool _needs_bitmap_reset;
284285

285286
public:

src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
2+
* Copyright (c) 2018, 2026, Red Hat, Inc. All rights reserved.
33
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
4-
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
*
77
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
2727
#include "gc/shared/markBitMap.inline.hpp"
2828
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
2929
#include "gc/shenandoah/shenandoahMarkingContext.hpp"
30+
#include "runtime/orderAccess.hpp"
3031

3132
ShenandoahMarkingContext::ShenandoahMarkingContext(MemRegion heap_region, MemRegion bitmap_region, size_t num_regions) :
3233
_mark_bit_map(heap_region, bitmap_region),
@@ -90,6 +91,7 @@ void ShenandoahMarkingContext::clear_bitmap(ShenandoahHeapRegion* r) {
9091

9192
if (top_bitmap > bottom) {
9293
_mark_bit_map.clear_range_large(MemRegion(bottom, top_bitmap));
94+
OrderAccess::storestore();
9395
_top_bitmaps[r->index()] = bottom;
9496
}
9597

0 commit comments

Comments
 (0)