lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b647ffbd0802200620h4015ca78o2482429b4502510a@mail.gmail.com>
Date:	Wed, 20 Feb 2008 15:20:52 +0100
From:	"Dmitry Adamushko" <dmitry.adamushko@...il.com>
To:	"Ahmed S. Darwish" <darwish.07@...il.com>
Cc:	"Ingo Molnar" <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Tasklets: Avoid duplicating __tasklet_{,hi_}schedule() code

On 20/02/2008, Ahmed S. Darwish <darwish.07@...il.com> wrote:
> On Wed, Feb 20, 2008 at 11:41:13AM +0100, Ingo Molnar wrote:
> >
> > * Ahmed S. Darwish <darwish.07@...il.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 ?

Look at irq_exit() in softirq.c.

The common sequence is ... -> do_IRQ() --> irq_exit() --> invoke_softirq()


-- 
Best regards,
Dmitry Adamushko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ