Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk15u-dev Public archive

Commit

Permalink
Backport afd5eefdae388a53a0d6bffc2cf94b878ac1881e
Browse files Browse the repository at this point in the history
  • Loading branch information
omikhaltsova committed Sep 15, 2021
1 parent 7d57365 commit 98e7104
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/hotspot/share/gc/parallel/mutableSpace.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -123,7 +123,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.
Atomic::release_store(end_addr(), mr.end());

if (clear_space) {
clear(mangle_space);
Expand Down
9 changes: 4 additions & 5 deletions src/hotspot/share/gc/parallel/psOldGen.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2020, 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
Expand Down Expand Up @@ -36,7 +36,6 @@
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/orderAccess.hpp"
#include "utilities/align.hpp"

PSOldGen::PSOldGen(ReservedSpace rs, size_t initial_size, size_t min_size,
Expand Down Expand Up @@ -352,9 +351,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);
Expand Down

0 comments on commit 98e7104

Please sign in to comment.