8206453: Taskqueue stats should count real steal attempts, not calls to GenericTaskQueueSet::steal

Reviewed-by: ehelin, kbarrett
This commit is contained in:
Thomas Schatzl 2018-07-09 14:12:50 +02:00
parent 466ccfe781
commit 66e825aa41
2 changed files with 12 additions and 15 deletions

View file

@ -61,10 +61,11 @@ public:
public:
inline TaskQueueStats() { reset(); }
inline void record_push() { ++_stats[push]; }
inline void record_pop() { ++_stats[pop]; }
inline void record_pop_slow() { record_pop(); ++_stats[pop_slow]; }
inline void record_steal(bool success);
inline void record_push() { ++_stats[push]; }
inline void record_pop() { ++_stats[pop]; }
inline void record_pop_slow() { record_pop(); ++_stats[pop_slow]; }
inline void record_steal_attempt() { ++_stats[steal_attempt]; }
inline void record_steal() { ++_stats[steal]; }
inline void record_overflow(size_t new_length);
TaskQueueStats & operator +=(const TaskQueueStats & addend);
@ -87,11 +88,6 @@ private:
static const char * const _names[last_stat_id];
};
void TaskQueueStats::record_steal(bool success) {
++_stats[steal_attempt];
if (success) ++_stats[steal];
}
void TaskQueueStats::record_overflow(size_t new_len) {
++_stats[overflow];
if (new_len > _stats[overflow_max_len]) _stats[overflow_max_len] = new_len;
@ -364,18 +360,19 @@ template <MEMFLAGS F> class TaskQueueSetSuperImpl: public CHeapObj<F>, public Ta
template<class T, MEMFLAGS F>
class GenericTaskQueueSet: public TaskQueueSetSuperImpl<F> {
public:
typedef typename T::element_type E;
private:
uint _n;
T** _queues;
public:
typedef typename T::element_type E;
bool steal_best_of_2(uint queue_num, int* seed, E& t);
public:
GenericTaskQueueSet(int n);
~GenericTaskQueueSet();
bool steal_best_of_2(uint queue_num, int* seed, E& t);
void register_queue(uint i, T* q);
T* queue(uint n);