Re: [PATCH] Tasklets: Avoid duplicating __tasklet_{,hi_}schedule() code

Ingo Molnar
2008-02-20T10:42:06Z

* Ahmed S. Darwish <darwish.07@gmail.com> wrote:

> > > - local_irq_disable();
> > > - t->next = __get_cpu_var(tasklet_vec).list;
> > > - __get_cpu_var(tasklet_vec).list = t;
> > > - __raise_softirq_irqoff(TASKLET_SOFTIRQ);
> > > - local_irq_enable();
> > > + /* We were not lucky enough to run, reschedule. */
> > > + __tasklet_schedule(t);
> >
> > i think there's a subtle difference that you missed: this one does
> > __raise_softirq_irqoff(), while __tasklet_schedule() does a
> > raise_softirq_irqoff(). (note the lack of undescores)
> >
> > the reason is to avoid infinitely self-activating tasklets.
>
> Indeed, thanks a lot for the explanation. (maybe it's time to check
> for new eyeglasses ;)).

nah, it's rather subtle and the code looked good to me at first but i
remembered that there was some small detail here to watch out for.

i really dont like tasklets due to their many, arbitrary scheduling
limitations, we should really use the "turn tasklets into kthreads"
patch i posted last year.

Ingo