8220594: ZGC: Remove superfluous ZPage::is_active()
Reviewed-by: stefank, eosterlund
--- a/src/hotspot/share/gc/z/zPage.cpp Mon Mar 18 11:50:40 2019 +0100
+++ b/src/hotspot/share/gc/z/zPage.cpp Mon Mar 18 11:50:40 2019 +0100
@@ -25,13 +25,11 @@
#include "gc/z/zPage.inline.hpp"
#include "gc/z/zPhysicalMemory.inline.hpp"
#include "gc/z/zVirtualMemory.inline.hpp"
-#include "runtime/orderAccess.hpp"
#include "utilities/align.hpp"
#include "utilities/debug.hpp"
ZPage::ZPage(uint8_t type, ZVirtualMemory vmem, ZPhysicalMemory pmem) :
_type(type),
- _active(0),
_numa_id((uint8_t)-1),
_seqnum(0),
_virtual(vmem),
@@ -47,30 +45,20 @@
}
ZPage::~ZPage() {
- assert(!is_active(), "Should not be active");
- assert(_physical.is_null(), "Should be detached");
+ assert(_physical.is_null(), "Should be null");
}
void ZPage::reset() {
- assert(!is_active(), "Should not be active");
-
_seqnum = ZGlobalSeqNum;
_top = start();
_livemap.reset();
-
- // Make sure we don't make the page active before
- // the reset of the above fields are visible.
- OrderAccess::storestore();
-
- _active = 1;
}
void ZPage::print_on(outputStream* out) const {
- out->print_cr(" %-6s " PTR_FORMAT " " PTR_FORMAT " " PTR_FORMAT " %s%s%s",
+ out->print_cr(" %-6s " PTR_FORMAT " " PTR_FORMAT " " PTR_FORMAT " %s%s",
type_to_string(), start(), top(), end(),
is_allocating() ? " Allocating" : "",
- is_relocatable() ? " Relocatable" : "",
- !is_active() ? " Inactive" : "");
+ is_relocatable() ? " Relocatable" : "");
}
void ZPage::print() const {
--- a/src/hotspot/share/gc/z/zPage.hpp Mon Mar 18 11:50:40 2019 +0100
+++ b/src/hotspot/share/gc/z/zPage.hpp Mon Mar 18 11:50:40 2019 +0100
@@ -37,7 +37,6 @@
private:
// Always hot
const uint8_t _type; // Page type
- volatile uint8_t _active; // Active flag
uint8_t _numa_id; // NUMA node affinity
uint32_t _seqnum; // Allocation sequence number
const ZVirtualMemory _virtual; // Virtual start/end address
@@ -80,9 +79,6 @@
uintptr_t block_start(uintptr_t addr) const;
bool block_is_obj(uintptr_t addr) const;
- bool is_active() const;
- void set_inactive();
-
bool is_allocating() const;
bool is_relocatable() const;
--- a/src/hotspot/share/gc/z/zPage.inline.hpp Mon Mar 18 11:50:40 2019 +0100
+++ b/src/hotspot/share/gc/z/zPage.inline.hpp Mon Mar 18 11:50:40 2019 +0100
@@ -149,20 +149,12 @@
return ZAddress::offset(addr) < top();
}
-inline bool ZPage::is_active() const {
- return OrderAccess::load_acquire(&_active) != 0;
-}
-
-inline void ZPage::set_inactive() {
- OrderAccess::release_store(&_active, (uint8_t)0);
-}
-
inline bool ZPage::is_allocating() const {
- return is_active() && _seqnum == ZGlobalSeqNum;
+ return _seqnum == ZGlobalSeqNum;
}
inline bool ZPage::is_relocatable() const {
- return is_active() && _seqnum < ZGlobalSeqNum;
+ return _seqnum < ZGlobalSeqNum;
}
inline bool ZPage::is_mapped() const {
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp Mon Mar 18 11:50:40 2019 +0100
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp Mon Mar 18 11:50:40 2019 +0100
@@ -470,9 +470,6 @@
// Update used statistics
decrease_used(page->size(), reclaimed);
- // Make page inactive
- page->set_inactive();
-
// Cache page
_cache.free_page(page);
--- a/src/hotspot/share/gc/z/zPageCache.cpp Mon Mar 18 11:50:40 2019 +0100
+++ b/src/hotspot/share/gc/z/zPageCache.cpp Mon Mar 18 11:50:40 2019 +0100
@@ -118,8 +118,6 @@
}
void ZPageCache::free_page(ZPage* page) {
- assert(!page->is_active(), "Invalid page state");
-
const uint8_t type = page->type();
if (type == ZPageTypeSmall) {
_small.get(page->numa_id()).insert_first(page);
--- a/test/hotspot/gtest/gc/z/test_zForwarding.cpp Mon Mar 18 11:50:40 2019 +0100
+++ b/test/hotspot/gtest/gc/z/test_zForwarding.cpp Mon Mar 18 11:50:40 2019 +0100
@@ -174,7 +174,6 @@
// Teardown page
page.physical_memory().clear();
- page.set_inactive();
}
// Run the given function with a few different input values.