Well. I thought about that. Not possible.
tasklet_disable is not the answer, because if the tasklet was
scheduled, it will stay forever in the tasklet queue. Also, I need to
forget forever about getting rid of the tasklet within the tasklet
itself, because it will just crash.
Look below, comments by me (you've got to love uncommented
code). So, it's not today that I will use tasklets.
Regards,
Jean
P.S. : By the way, regarding flow control between TCP and netdevice
(our previous e-mail exchange with Paul), have you investigated the
effect of skb->destructor; (for example sock_wfree()).
-------------------------------------------------------------
static void tasklet_action(struct softirq_action *a)
{
int cpu = smp_processor_id();
struct tasklet_struct *list;
local_irq_disable();
list = tasklet_vec[cpu].list;
tasklet_vec[cpu].list = NULL;
local_irq_enable();
while (list) {
struct tasklet_struct *t = list;
list = list->next;
if (tasklet_trylock(t)) {
if (!atomic_read(&t->count)) {
if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
BUG();
// Call tasklet handler
t->func(t->data);
// If tasklet was killed/destroyed/kfree above, we will die
tasklet_unlock(t);
continue;
}
tasklet_unlock(t);
}
// Tasklet is disabled, put back in tasklet queue
local_irq_disable();
t->next = tasklet_vec[cpu].list;
tasklet_vec[cpu].list = t;
__cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
local_irq_enable();
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/