Re: [patch] smptimers, old BH removal, tq-cleanup, 2.5.39

Ingo Molnar
2002-09-29T19:12:27Z

yes, wrt. keventd i was thinking along the same line - but in a different,
perhaps cleaner and simpler direction.

i'd like to introduce the following interfaces:

- create_work_queue(wq, handler_fn)

- destroy_work_queue(wq)

- queue_work(wq, work_fn, work_data)

- flush_work_queue(wq)

this is an extension of the keventd concept. A work queue is a simplified
interface to create a kernel thread that gets work queued from IRQ and
process contexts. No more, no less.

there would be a number of 'default' work-queues that would be created
upon bootup:

- &irq_workqueue
- &io_workqueue

each work queue would get its own separate kernel thread. schedule_task()
would simply queue to the irq_workqueue. We could make the irq_workqueue's
kernel thread a highprio RT thread, to make it really softirq-alike. (Or
for the very specific case of BH_IMMEDIATE type of stricly IRQ-safe work,
we could add a tasklet that works down this queue.)

There's tons of code within the kernel that can be streamlined this way,
most of the helper threads do this kind of functionality. (I'll post a
patch soon to show how it would look like.)

Ingo