Skip to content

Commit

Permalink
gcthreads adaptive fix with overloaded max count
Browse files Browse the repository at this point in the history
In a rare scenario, if a user specifies max GC thread count above h/w
available thread count, adaptive threading math would incorrectly
disregard the current h/w thread count.

This fix makes adaptive threading math apply its logic on top of
taskActiveThreadCount rather than _threadCount. It is more correct since
the former not already accounts for the latter (_threadCount, what is
currently spawned count of GC threads) but also
accounts for _activeThreadCount which in turn has been adjusted to
account of the number of h/w available threads.

Signed-off-by: Aleksandar Micic <Aleksandar_Micic@ca.ibm.com>
  • Loading branch information
Aleksandar Micic authored and Aleksandar Micic committed Jan 30, 2025
1 parent 6bfb20f commit 100f70f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gc/base/ParallelDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ MM_ParallelDispatcher::recomputeActiveThreadCountForTask(MM_EnvironmentBase *env
/* Bound the recommended thread count. Determine the upper bound for the thread count,
* This will either be the user specified gcMaxThreadCount (-XgcmaxthreadsN) or else default max
*/
taskActiveThreadCount = OMR_MIN(_threadCount, task->getRecommendedWorkingThreads());
taskActiveThreadCount = OMR_MIN(taskActiveThreadCount, task->getRecommendedWorkingThreads());

_activeThreadCount = taskActiveThreadCount;

Expand Down

0 comments on commit 100f70f

Please sign in to comment.