mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
MINOR: task: remove grq_total and use rq_total instead
grq_total was only used to know how many tasks were being queued in the global runqueue for stats purposes, and that was transferred to the per thread rq_total counter once assigned. We don't need this anymore since we know where they are, so let's just directly update rq_total and drop that one.
This commit is contained in:
parent
b17dd6cc19
commit
da195e8aab
@ -90,7 +90,6 @@
|
|||||||
|
|
||||||
/* a few exported variables */
|
/* a few exported variables */
|
||||||
extern volatile unsigned long global_tasks_mask; /* Mask of threads with tasks in the global runqueue */
|
extern volatile unsigned long global_tasks_mask; /* Mask of threads with tasks in the global runqueue */
|
||||||
extern unsigned int grq_total; /* total number of entries in the global run queue, atomic */
|
|
||||||
extern unsigned int niced_tasks; /* number of niced tasks in the run queue */
|
extern unsigned int niced_tasks; /* number of niced tasks in the run queue */
|
||||||
|
|
||||||
extern struct pool_head *pool_head_task;
|
extern struct pool_head *pool_head_task;
|
||||||
@ -147,9 +146,6 @@ static inline int total_run_queues()
|
|||||||
{
|
{
|
||||||
int thr, ret = 0;
|
int thr, ret = 0;
|
||||||
|
|
||||||
#ifdef USE_THREAD
|
|
||||||
ret = _HA_ATOMIC_LOAD(&grq_total);
|
|
||||||
#endif
|
|
||||||
for (thr = 0; thr < global.nbthread; thr++)
|
for (thr = 0; thr < global.nbthread; thr++)
|
||||||
ret += _HA_ATOMIC_LOAD(&ha_thread_ctx[thr].rq_total);
|
ret += _HA_ATOMIC_LOAD(&ha_thread_ctx[thr].rq_total);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -42,7 +42,6 @@ __decl_aligned_rwlock(wq_lock); /* RW lock related to the wait queue */
|
|||||||
|
|
||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
struct eb_root timers; /* sorted timers tree, global, accessed under wq_lock */
|
struct eb_root timers; /* sorted timers tree, global, accessed under wq_lock */
|
||||||
unsigned int grq_total; /* total number of entries in the global run queue, atomic */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -233,7 +232,7 @@ void __task_wakeup(struct task *t)
|
|||||||
if (thr != tid) {
|
if (thr != tid) {
|
||||||
root = &ha_thread_ctx[thr].rqueue_shared;
|
root = &ha_thread_ctx[thr].rqueue_shared;
|
||||||
|
|
||||||
_HA_ATOMIC_INC(&grq_total);
|
_HA_ATOMIC_INC(&ha_thread_ctx[thr].rq_total);
|
||||||
HA_SPIN_LOCK(TASK_RQ_LOCK, &ha_thread_ctx[thr].rqsh_lock);
|
HA_SPIN_LOCK(TASK_RQ_LOCK, &ha_thread_ctx[thr].rqsh_lock);
|
||||||
|
|
||||||
if (t->tid < 0)
|
if (t->tid < 0)
|
||||||
@ -897,12 +896,6 @@ void process_runnable_tasks()
|
|||||||
if (lpicked + gpicked) {
|
if (lpicked + gpicked) {
|
||||||
tt->tl_class_mask |= 1 << TL_NORMAL;
|
tt->tl_class_mask |= 1 << TL_NORMAL;
|
||||||
_HA_ATOMIC_ADD(&tt->tasks_in_list, lpicked + gpicked);
|
_HA_ATOMIC_ADD(&tt->tasks_in_list, lpicked + gpicked);
|
||||||
#ifdef USE_THREAD
|
|
||||||
if (gpicked) {
|
|
||||||
_HA_ATOMIC_SUB(&grq_total, gpicked);
|
|
||||||
_HA_ATOMIC_ADD(&tt->rq_total, gpicked);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
activity[tid].tasksw += lpicked + gpicked;
|
activity[tid].tasksw += lpicked + gpicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user