Re: Concurrent bottom halves

B. James Phillippe (bryan@terran.org)
Fri, 26 Feb 1999 10:07:44 -0800 (PST)


On Fri, 26 Feb 1999, Andrea Arcangeli wrote:

> On Thu, 25 Feb 1999, B. James Phillippe wrote:
>
> >Greetings,
> >
> >Is it possible in Linux-2.2 for a driver to mark a bottom half from within
> >a bottom half and have them execute concurrently? I would like to mark a
> >bottom half (tq_immediate) from code executing in net_bh, and have the new
> >bottom half executing concurrently with net_bh.
>
> That's impossible. The main feature of bh handler is that they run
> _always_ serialized in respect of themself.

I understand that a bh is not re-entrant, if that's what you mean. But do
you also mean to say that if I mark a totally separate bottom half from
within some bottom half code that takes a while to complete, that the
marked bh won't run until the first one returns?

Here is why I ask. I am working on some code that does encryption within
net_bh (for IPSec). I'd like to be able to run through a queue of packets,
and for each one that needs encryption done, put them in a separate queue.
I want some other routine to be able to start working on encrypting these
queued packets without having to wait for net_bh to finish. This way
net_bh can continue de/queueing packets while the encryption is happening
concurrently (elsewhere). Currently I am doing it with hardware
encryption, where the ISR for the hardware does the job of encrypting
packets/continuing processing asynchronously with respect to net_bh. The
interrupt handler retrieves the data and marks tq_immediate (if needed) to
do the work of continuing packet processing (after encryption). But I'd
like to have it work similarly for software crypto so the overall design
doesn't change for software-only version. What I really want is some
multi-threading capability.

If two separate bh's cannot operate concurrently (on UP, anyway), is there
a possibility of using a kernel thread of some kind?

thanks,
-bp

--
B. James Phillippe		. bryan@terran.org
Software Engineer, WGT Inc.	. http://www.terran.org/~bryan

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/