Skip to content
Permalink
Browse files
8260704: ParallelGC: oldgen expansion needs release-store for _end
Move JDK-8257999 barrier to correct location.

Reviewed-by: yan
Backport-of: afd5eef
  • Loading branch information
Olga Mikhaltsova authored and Yuri Nesterenko committed Sep 16, 2021
1 parent 56158e5 commit 56d491cb7017736eb0f06cea7db7013176ee03d5
Showing 2 changed files with 11 additions and 7 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"
#include "utilities/align.hpp"
@@ -123,7 +124,11 @@ void MutableSpace::initialize(MemRegion mr,
}

set_bottom(mr.start());
set_end(mr.end());
// When expanding concurrently with callers of cas_allocate, setting end
// makes the new space available for allocation by other threads. So this
// assignment must follow all other configuration and initialization that
// might be done for expansion.
OrderAccess::release_store(end_addr(), mr.end());

if (clear_space) {
clear(mangle_space);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/orderAccess.hpp"
#include "utilities/align.hpp"

inline const char* PSOldGen::select_name() {
@@ -403,9 +402,9 @@ void PSOldGen::post_resize() {
start_array()->set_covered_region(new_memregion);
ParallelScavengeHeap::heap()->card_table()->resize_covered_region(new_memregion);

// Ensure the space bounds are updated and made visible to other
// threads after the other data structures have been resized.
OrderAccess::storestore();
// The update of the space's end is done by this call. As that
// makes the new space available for concurrent allocation, this
// must be the last step when expanding.
object_space()->initialize(new_memregion,
SpaceDecorator::DontClear,
SpaceDecorator::DontMangle);

1 comment on commit 56d491c

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 56d491c Sep 16, 2021

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.