TASKLET_STATE_RUN
When set, this indicates that the tasklet is being executed; on a uniprocessor system this flag is not used because there is no need to check whether a specific tasklet is running.
In multiprocessor systems, checks the TASKLET_STATE_RUN flag of the tasklet.
-
If it is set, a tasklet of the same type is already running on another CPU, so the function reinserts the task descriptor in the list pointed to by tasklet_vec[n] or tasklet_hi_vec[n] and activates the TASKLET_SOFTIRQ or HI_SOFTIRQ softirq again. In this way, execution of the tasklet is deferred until no other tasklets of the same type are running on other CPUs.
300 {
301 struct tasklet_struct *next;
302 unsigned long state; // tasklet state sched/run
303 atomic_t count; //lock
304 void (*func)(unsigned long);
305 unsigned long data;
306 };