From: "Ahmed S. Darwish" <darwish.07@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@redhat.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Tasklets: Avoid duplicating __tasklet_{,hi_}schedule() code
Date: Wed, 20 Feb 2008 15:37:18 +0200 [thread overview]
Message-ID: <20080220133718.GA8205@ubuntu> (raw)
In-Reply-To: <20080220104113.GI3881@elte.hu>
On Wed, Feb 20, 2008 at 11:41:13AM +0100, Ingo Molnar wrote:
>
> * 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.
>
While we are at it, there's a small question that is bothering me
for a while (and I'm really thankful for help).
I keep reading that softirqs (and naturally, tasklets) got executed
in interrupt context at the return from hardirq code path.
Checking entry_32.S, I find no mentioning of softirqs on the return
path (beginning from ret_from_intr: to restore_all: )
The only invocation I'm able to find is from local_bh_enable() and
from ksoftirqd/n threads (by calling do_softirq()). AFAIK, both
invocations occur in a _nont-interrupt_ context (exception context).
So, where does the interrupt-context tasklets invocation really
occur ?
Thanks
--
Ahmed S. Darwish
Homepage: http://darwish.07.googlepages.com
Blog: http://darwish-07.blogspot.com
next prev parent reply other threads:[~2008-02-20 13:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-19 15:37 [PATCH] Tasklets: Avoid duplicating __tasklet_{,hi_}schedule() code Ahmed S. Darwish
2008-02-19 15:52 ` Ingo Molnar
2008-02-19 16:27 ` Ahmed S. Darwish
2008-02-20 10:41 ` Ingo Molnar
2008-02-20 13:37 ` Ahmed S. Darwish [this message]
2008-02-20 14:20 ` Dmitry Adamushko
2008-02-20 19:39 ` Ahmed S. Darwish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080220133718.GA8205@ubuntu \
--to=darwish.07@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox