mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-13 17:07:31 +00:00
CLEANUP: task: remove the unused and mishandled global_rqueue_size
This counter is only updated and never used, and in addition it's done without any atomicity so it's very unlikely to be correct on multi-CPU systems! Let's just remove it since it's not used.
This commit is contained in:
parent
e72a3f4489
commit
69a7b8fc6c
@ -101,7 +101,6 @@ extern THREAD_LOCAL struct task_per_thread *sched; /* current's thread scheduler
|
|||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
extern struct eb_root timers; /* sorted timers tree, global */
|
extern struct eb_root timers; /* sorted timers tree, global */
|
||||||
extern struct eb_root rqueue; /* tree constituting the run queue */
|
extern struct eb_root rqueue; /* tree constituting the run queue */
|
||||||
extern int global_rqueue_size; /* Number of element sin the global runqueue */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct task_per_thread task_per_thread[MAX_THREADS];
|
extern struct task_per_thread task_per_thread[MAX_THREADS];
|
||||||
@ -295,10 +294,9 @@ static inline struct task *__task_unlink_rq(struct task *t)
|
|||||||
{
|
{
|
||||||
_HA_ATOMIC_SUB(&tasks_run_queue, 1);
|
_HA_ATOMIC_SUB(&tasks_run_queue, 1);
|
||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
if (t->state & TASK_GLOBAL) {
|
if (t->state & TASK_GLOBAL)
|
||||||
_HA_ATOMIC_AND(&t->state, ~TASK_GLOBAL);
|
_HA_ATOMIC_AND(&t->state, ~TASK_GLOBAL);
|
||||||
global_rqueue_size--;
|
else
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
sched->rqueue_size--;
|
sched->rqueue_size--;
|
||||||
eb32sc_delete(&t->rq);
|
eb32sc_delete(&t->rq);
|
||||||
|
@ -50,7 +50,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 */
|
struct eb_root timers; /* sorted timers tree, global */
|
||||||
struct eb_root rqueue; /* tree constituting the run queue */
|
struct eb_root rqueue; /* tree constituting the run queue */
|
||||||
int global_rqueue_size; /* Number of element sin the global runqueue */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned int rqueue_ticks; /* insertion count */
|
static unsigned int rqueue_ticks; /* insertion count */
|
||||||
@ -150,7 +149,6 @@ void __task_wakeup(struct task *t, struct eb_root *root)
|
|||||||
eb32sc_insert(root, &t->rq, t->thread_mask);
|
eb32sc_insert(root, &t->rq, t->thread_mask);
|
||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
if (root == &rqueue) {
|
if (root == &rqueue) {
|
||||||
global_rqueue_size++;
|
|
||||||
_HA_ATOMIC_OR(&t->state, TASK_GLOBAL);
|
_HA_ATOMIC_OR(&t->state, TASK_GLOBAL);
|
||||||
HA_SPIN_UNLOCK(TASK_RQ_LOCK, &rq_lock);
|
HA_SPIN_UNLOCK(TASK_RQ_LOCK, &rq_lock);
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user