]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: add a new pointer to current tasklet queue
authorWilly Tarreau <w@1wt.eu>
Tue, 23 Jun 2020 14:35:38 +0000 (16:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Jun 2020 14:35:38 +0000 (16:35 +0200)
In task_per_thread[] we now have current_queue which is a pointer to
the current tasklet_list entry being evaluated. This will be used to
know the class under which the current task/tasklet is currently
running.

include/haproxy/task-t.h
src/task.c

index 2ea2b3ca50941b1a27d49d367c9b68096b54d9e2..7d23f68fe2f11d1c9397c48964ed7a6539ad202b 100644 (file)
@@ -77,6 +77,7 @@ struct task_per_thread {
        int task_list_size;     /* Number of tasks among the tasklets */
        int rqueue_size;        /* Number of elements in the per-thread run queue */
        struct task *current;   /* current task (not tasklet) */
+       struct list *current_queue; /* points to current tasklet list being run */
        __attribute__((aligned(64))) char end[0];
 };
 
index 2097555f1f97ccc2c1287bfba5130b2b5718082a..1f7fd5342e382240aabf7640e569ddb22fcac264 100644 (file)
@@ -330,6 +330,7 @@ int run_tasks_from_list(struct list *list, int max)
        void *ctx;
        int done = 0;
 
+       sched->current_queue = list;
        while (done < max && !LIST_ISEMPTY(list)) {
                t = (struct task *)LIST_ELEM(list->n, struct tasklet *, list);
                state = (t->state & (TASK_SHARED_WQ|TASK_SELF_WAKING));
@@ -400,6 +401,8 @@ int run_tasks_from_list(struct list *list, int max)
                }
                done++;
        }
+
+       sched->current_queue = NULL;
        return done;
 }