Kernelsoftirqc

static void tasklet_action(struct softirq_action *a)

struct tasklet_struct *t = list; list = list->next;

if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))

BUG(); t->func(t->data); tasklet_unlock(t); continue;

tasklet_unlock(t);

Executing tasklets in a while loop is similar to the mechanism used when handling softIRQs.

Because a tasklet can be executed on only one processor at a time, but other tasklets may run in parallel, tasklet-specific locking is required. The state state is used as the locking variable. Before the handler function of a tasklet is executed, the kernel uses tasklet_trylock to check whether the state of the tasklet is TASKLET_STATE_RUN; in other words, whether it is already running on another processor of the system:

Continue reading here: Info

Was this article helpful?

0 0