MEDIUM: tasklets: Make the tasklet list a struct mt_list.
Change the tasklet code so that the tasklet list is now a mt_list.
That means that tasklet now do have an associated tid, for the thread it
is expected to run on, and any thread can now call tasklet_wakeup() for
that tasklet.
One can change the associated tid with tasklet_set_tid().
diff --git a/include/types/task.h b/include/types/task.h
index 481d563..aac3a6c 100644
--- a/include/types/task.h
+++ b/include/types/task.h
@@ -61,7 +61,7 @@
struct task_per_thread {
struct eb_root timers; /* tree constituting the per-thread wait queue */
struct eb_root rqueue; /* tree constituting the per-thread run queue */
- struct list task_list; /* List of tasks to be run, mixing tasks and tasklets */
+ struct mt_list task_list; /* List of tasks to be run, mixing tasks and tasklets */
int task_list_size; /* Number of tasks in the task_list */
int rqueue_size; /* Number of elements in the per-thread run queue */
__attribute__((aligned(64))) char end[0];
@@ -94,7 +94,8 @@
/* lightweight tasks, without priority, mainly used for I/Os */
struct tasklet {
TASK_COMMON; /* must be at the beginning! */
- struct list list;
+ struct mt_list list;
+ int tid; /* TID of the tasklet owner */
};
#define TASK_IS_TASKLET(t) ((t)->nice == -32768)