mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8167108: inconsistent handling of SR_lock can lead to crashes
Add Thread Safe Memory Reclamation (Thread-SMR) mechanism. Co-authored-by: Erik Osterlund <erik.osterlund@oracle.com> Co-authored-by: Robbin Ehn <robbin.ehn@oracle.com> Reviewed-by: coleenp, dcubed, dholmes, eosterlund, gthornbr, kbarrett, rehn, sspitsyn, stefank
This commit is contained in:
parent
cd0c6d0fae
commit
0dff96ff0b
67 changed files with 4220 additions and 995 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "memory/universe.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/thread.inline.hpp"
|
||||
#include "runtime/threadSMR.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
|
||||
// Thread-Local Edens support
|
||||
|
@ -48,7 +49,7 @@ void ThreadLocalAllocBuffer::clear_before_allocation() {
|
|||
void ThreadLocalAllocBuffer::accumulate_statistics_before_gc() {
|
||||
global_stats()->initialize();
|
||||
|
||||
for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
|
||||
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
|
||||
thread->tlab().accumulate_statistics();
|
||||
thread->tlab().initialize_statistics();
|
||||
}
|
||||
|
@ -130,7 +131,7 @@ void ThreadLocalAllocBuffer::make_parsable(bool retire, bool zap) {
|
|||
|
||||
void ThreadLocalAllocBuffer::resize_all_tlabs() {
|
||||
if (ResizeTLAB) {
|
||||
for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
|
||||
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
|
||||
thread->tlab().resize();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue