Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
da32f40e
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
da32f40e
编写于
5月 14, 2014
作者:
P
pliden
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8040803: G1: Concurrent mark hangs when mark stack overflows
Reviewed-by: brutisso, ehelin
上级
0fff0369
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
51 addition
and
15 deletion
+51
-15
src/share/vm/gc_implementation/g1/concurrentMark.cpp
src/share/vm/gc_implementation/g1/concurrentMark.cpp
+24
-4
src/share/vm/utilities/workgroup.cpp
src/share/vm/utilities/workgroup.cpp
+14
-6
src/share/vm/utilities/workgroup.hpp
src/share/vm/utilities/workgroup.hpp
+13
-5
未找到文件。
src/share/vm/gc_implementation/g1/concurrentMark.cpp
浏览文件 @
da32f40e
...
...
@@ -978,7 +978,9 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
if
(
concurrent
())
{
ConcurrentGCThread
::
stsLeave
();
}
_first_overflow_barrier_sync
.
enter
();
bool
barrier_aborted
=
!
_first_overflow_barrier_sync
.
enter
();
if
(
concurrent
())
{
ConcurrentGCThread
::
stsJoin
();
}
...
...
@@ -986,7 +988,17 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
// more work
if
(
verbose_low
())
{
gclog_or_tty
->
print_cr
(
"[%u] leaving first barrier"
,
worker_id
);
if
(
barrier_aborted
)
{
gclog_or_tty
->
print_cr
(
"[%u] aborted first barrier"
,
worker_id
);
}
else
{
gclog_or_tty
->
print_cr
(
"[%u] leaving first barrier"
,
worker_id
);
}
}
if
(
barrier_aborted
)
{
// If the barrier aborted we ignore the overflow condition and
// just abort the whole marking phase as quickly as possible.
return
;
}
// If we're executing the concurrent phase of marking, reset the marking
...
...
@@ -1026,14 +1038,20 @@ void ConcurrentMark::enter_second_sync_barrier(uint worker_id) {
if
(
concurrent
())
{
ConcurrentGCThread
::
stsLeave
();
}
_second_overflow_barrier_sync
.
enter
();
bool
barrier_aborted
=
!
_second_overflow_barrier_sync
.
enter
();
if
(
concurrent
())
{
ConcurrentGCThread
::
stsJoin
();
}
// at this point everything should be re-initialized and ready to go
if
(
verbose_low
())
{
gclog_or_tty
->
print_cr
(
"[%u] leaving second barrier"
,
worker_id
);
if
(
barrier_aborted
)
{
gclog_or_tty
->
print_cr
(
"[%u] aborted second barrier"
,
worker_id
);
}
else
{
gclog_or_tty
->
print_cr
(
"[%u] leaving second barrier"
,
worker_id
);
}
}
}
...
...
@@ -3232,6 +3250,8 @@ void ConcurrentMark::abort() {
for
(
uint
i
=
0
;
i
<
_max_worker_id
;
++
i
)
{
_tasks
[
i
]
->
clear_region_fields
();
}
_first_overflow_barrier_sync
.
abort
();
_second_overflow_barrier_sync
.
abort
();
_has_aborted
=
true
;
SATBMarkQueueSet
&
satb_mq_set
=
JavaThread
::
satb_mark_queue_set
();
...
...
src/share/vm/utilities/workgroup.cpp
浏览文件 @
da32f40e
...
...
@@ -378,21 +378,22 @@ const char* AbstractGangTask::name() const {
WorkGangBarrierSync
::
WorkGangBarrierSync
()
:
_monitor
(
Mutex
::
safepoint
,
"work gang barrier sync"
,
true
),
_n_workers
(
0
),
_n_completed
(
0
),
_should_reset
(
false
)
{
_n_workers
(
0
),
_n_completed
(
0
),
_should_reset
(
false
)
,
_aborted
(
false
)
{
}
WorkGangBarrierSync
::
WorkGangBarrierSync
(
uint
n_workers
,
const
char
*
name
)
:
_monitor
(
Mutex
::
safepoint
,
name
,
true
),
_n_workers
(
n_workers
),
_n_completed
(
0
),
_should_reset
(
false
)
{
_n_workers
(
n_workers
),
_n_completed
(
0
),
_should_reset
(
false
)
,
_aborted
(
false
)
{
}
void
WorkGangBarrierSync
::
set_n_workers
(
uint
n_workers
)
{
_n_workers
=
n_workers
;
_n_completed
=
0
;
_n_workers
=
n_workers
;
_n_completed
=
0
;
_should_reset
=
false
;
_aborted
=
false
;
}
void
WorkGangBarrierSync
::
enter
()
{
bool
WorkGangBarrierSync
::
enter
()
{
MutexLockerEx
x
(
monitor
(),
Mutex
::
_no_safepoint_check_flag
);
if
(
should_reset
())
{
// The should_reset() was set and we are the first worker to enter
...
...
@@ -415,10 +416,17 @@ void WorkGangBarrierSync::enter() {
set_should_reset
(
true
);
monitor
()
->
notify_all
();
}
else
{
while
(
n_completed
()
!=
n_workers
())
{
while
(
n_completed
()
!=
n_workers
()
&&
!
aborted
()
)
{
monitor
()
->
wait
(
/* no_safepoint_check */
true
);
}
}
return
!
aborted
();
}
void
WorkGangBarrierSync
::
abort
()
{
MutexLockerEx
x
(
monitor
(),
Mutex
::
_no_safepoint_check_flag
);
set_aborted
();
monitor
()
->
notify_all
();
}
// SubTasksDone functions.
...
...
src/share/vm/utilities/workgroup.hpp
浏览文件 @
da32f40e
...
...
@@ -359,18 +359,20 @@ class FlexibleWorkGang: public WorkGang {
class
WorkGangBarrierSync
:
public
StackObj
{
protected:
Monitor
_monitor
;
uint
_n_workers
;
uint
_n_completed
;
uint
_n_workers
;
uint
_n_completed
;
bool
_should_reset
;
bool
_aborted
;
Monitor
*
monitor
()
{
return
&
_monitor
;
}
uint
n_workers
()
{
return
_n_workers
;
}
uint
n_completed
()
{
return
_n_completed
;
}
bool
should_reset
()
{
return
_should_reset
;
}
bool
aborted
()
{
return
_aborted
;
}
void
zero_completed
()
{
_n_completed
=
0
;
}
void
inc_completed
()
{
_n_completed
++
;
}
void
set_aborted
()
{
_aborted
=
true
;
}
void
set_should_reset
(
bool
v
)
{
_should_reset
=
v
;
}
public:
...
...
@@ -383,8 +385,14 @@ public:
// Enter the barrier. A worker that enters the barrier will
// not be allowed to leave until all other threads have
// also entered the barrier.
void
enter
();
// also entered the barrier or the barrier is aborted.
// Returns false if the barrier was aborted.
bool
enter
();
// Aborts the barrier and wakes up any threads waiting for
// the barrier to complete. The barrier will remain in the
// aborted state until the next call to set_n_workers().
void
abort
();
};
// A class to manage claiming of subtasks within a group of tasks. The
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录