/* a few exported variables */
-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_tasklet;
extern struct pool_head *pool_head_notification;
HA_RWLOCK_T wq_lock; /* RW lock related to the wait queue below */
struct eb_root timers; /* wait queue (sorted timers tree, global, accessed under wq_lock) */
+ uint niced_tasks; /* number of niced tasks in this group's run queues */
+
/* pad to cache line (64B) */
char __pad[0]; /* unused except to check remaining room */
char __end[0] __attribute__((aligned(64)));
*/
DECLARE_POOL(pool_head_notification, "notification", sizeof(struct notification));
-unsigned int niced_tasks = 0; /* number of niced tasks in the run queue */
-
/* Flags the task <t> for immediate destruction and puts it into its first
* thread's shared tasklet list if not yet queued/running. This will bypass
if (likely(t->nice)) {
int offset;
- _HA_ATOMIC_INC(&niced_tasks);
+ _HA_ATOMIC_INC(&tg_ctx->niced_tasks);
offset = t->nice * (int)global.tune.runqueue_depth;
t->rq.key += offset;
}
max_processed = global.tune.runqueue_depth;
- if (likely(niced_tasks))
+ if (likely(tg_ctx->niced_tasks))
max_processed = (max_processed + 3) / 4;
if (max_processed < th_ctx->rq_total && th_ctx->rq_total <= 2*max_processed) {
}
#endif
if (t->nice)
- _HA_ATOMIC_DEC(&niced_tasks);
+ _HA_ATOMIC_DEC(&tg_ctx->niced_tasks);
/* Add it to the local task list */
LIST_APPEND(&tt->tasklets[TL_NORMAL], &((struct tasklet *)t)->list);