8080879: Remove FlexibleWorkGang::set_for_termination

Reviewed-by: brutisso, kbarrett, pliden
This commit is contained in:
Stefan Karlsson 2015-05-25 11:41:34 +02:00
parent b04d2bca57
commit f3f59e37c9
7 changed files with 17 additions and 41 deletions

@ -5258,18 +5258,14 @@ public:
CMSBitMap* mark_bit_map,
AbstractWorkGang* workers,
OopTaskQueueSet* task_queues):
// XXX Should superclass AGTWOQ also know about AWG since it knows
// about the task_queues used by the AWG? Then it could initialize
// the terminator() object. See 6984287. The set_for_termination()
// below is a temporary band-aid for the regression in 6984287.
AbstractGangTaskWOopQueues("Process referents by policy in parallel",
task_queues),
task_queues,
workers->active_workers()),
_task(task),
_collector(collector), _span(span), _mark_bit_map(mark_bit_map)
{
assert(_collector->_span.equals(_span) && !_span.is_empty(),
"Inconsistency in _span");
set_for_termination(workers->active_workers());
}
OopTaskQueueSet* task_queues() { return queues(); }

@ -576,12 +576,6 @@ ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* old_gen,
_strong_roots_scope(strong_roots_scope)
{}
// Reset the terminator for the given number of
// active threads.
void ParNewGenTask::set_for_termination(uint active_workers) {
_state_set->reset(active_workers, _gen->promotion_failed());
}
void ParNewGenTask::work(uint worker_id) {
GenCollectedHeap* gch = GenCollectedHeap::heap();
// Since this is being done in a separate thread, need new resource
@ -757,9 +751,6 @@ public:
private:
virtual void work(uint worker_id);
virtual void set_for_termination(uint active_workers) {
_state_set.terminator()->reset_for_reuse(active_workers);
}
private:
ParNewGeneration& _gen;
ProcessTask& _task;
@ -949,6 +940,8 @@ void ParNewGeneration::collect(bool full,
*to(), *this, *_old_gen, *task_queues(),
_overflow_stacks, desired_plab_sz(), _term);
thread_state_set.reset(n_workers, promotion_failed());
{
StrongRootsScope srs(n_workers);

@ -250,10 +250,6 @@ public:
HeapWord* young_old_boundary() { return _young_old_boundary; }
void work(uint worker_id);
// Reset the terminator in ParScanThreadStateSet for
// "active_workers" threads.
virtual void set_for_termination(uint active_workers);
};
class KeepAliveClosure: public DefNewGeneration::KeepAliveClosure {

@ -147,6 +147,13 @@ public:
bool completed() const { return _status == COMPLETED; }
bool aborted() const { return _status == ABORTED; }
bool active() const { return _status == ACTIVE; }
// This method configures the task for proper termination.
// Some tasks do not have any requirements on termination
// and may inherit this method that does nothing. Some
// tasks do some coordination on termination and override
// this method to implement that coordination.
virtual void set_for_termination(uint active_workers) {}
};
// Class YieldingWorkGang: A subclass of WorkGang.
// In particular, a YieldingWorkGang is made up of

@ -4279,12 +4279,13 @@ protected:
Mutex* stats_lock() { return &_stats_lock; }
public:
G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor)
G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor, uint n_workers)
: AbstractGangTask("G1 collection"),
_g1h(g1h),
_queues(task_queues),
_root_processor(root_processor),
_terminator(0, _queues),
_terminator(n_workers, _queues),
_n_workers(n_workers),
_stats_lock(Mutex::leaf, "parallel G1 stats lock", true)
{}
@ -4296,11 +4297,6 @@ public:
ParallelTaskTerminator* terminator() { return &_terminator; }
virtual void set_for_termination(uint active_workers) {
terminator()->reset_for_reuse(active_workers);
_n_workers = active_workers;
}
// Helps out with CLD processing.
//
// During InitialMark we need to:
@ -5343,7 +5339,7 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
{
G1RootProcessor root_processor(this, n_workers);
G1ParTask g1_par_task(this, _task_queues, &root_processor);
G1ParTask g1_par_task(this, _task_queues, &root_processor, n_workers);
// InitialMark needs claim bits to keep track of the marked-through CLDs.
if (g1_policy()->during_initial_mark_pause()) {
ClassLoaderDataGraph::clear_claimed_marks();

@ -133,8 +133,6 @@ void WorkGang::run_task(AbstractGangTask* task) {
}
void WorkGang::run_task(AbstractGangTask* task, uint no_of_parallel_workers) {
task->set_for_termination(no_of_parallel_workers);
// This thread is executed by the VM thread which does not block
// on ordinary MutexLocker's.
MutexLockerEx ml(monitor(), Mutex::_no_safepoint_check_flag);

@ -59,13 +59,6 @@ public:
// The argument tells you which member of the gang you are.
virtual void work(uint worker_id) = 0;
// This method configures the task for proper termination.
// Some tasks do not have any requirements on termination
// and may inherit this method that does nothing. Some
// tasks do some coordination on termination and override
// this method to implement that coordination.
virtual void set_for_termination(uint active_workers) {};
// Debugging accessor for the name.
const char* name() const PRODUCT_RETURN_(return NULL;);
int counter() { return _counter; }
@ -99,12 +92,9 @@ class AbstractGangTaskWOopQueues : public AbstractGangTask {
OopTaskQueueSet* _queues;
ParallelTaskTerminator _terminator;
public:
AbstractGangTaskWOopQueues(const char* name, OopTaskQueueSet* queues) :
AbstractGangTask(name), _queues(queues), _terminator(0, _queues) {}
AbstractGangTaskWOopQueues(const char* name, OopTaskQueueSet* queues, uint n_threads) :
AbstractGangTask(name), _queues(queues), _terminator(n_threads, _queues) {}
ParallelTaskTerminator* terminator() { return &_terminator; }
virtual void set_for_termination(uint active_workers) {
terminator()->reset_for_reuse(active_workers);
}
OopTaskQueueSet* queues() { return _queues; }
};