diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-09-30 22:17:42 -0700 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2002-09-30 22:17:42 -0700 |
| commit | 6ed12ff83c765aeda7d38d3bf9df7d46d24bfb11 (patch) | |
| tree | d2dd4a9cefd38743d3e51fbbab3d79920bb19ae1 /drivers/char/ip2 | |
| parent | 7570df54ef8cc5b42500d26562ff50fcbe265aa2 (diff) | |
[PATCH] Workqueue Abstraction
This is the next iteration of the workqueue abstraction.
The framework includes:
- per-CPU queueing support.
on SMP there is a per-CPU worker thread (bound to its CPU) and per-CPU
work queues - this feature is completely transparent to workqueue-users.
keventd automatically uses this feature. XFS can now update to work-queues
and have the same per-CPU performance as it had with its per-CPU worker
threads.
- delayed work submission
there's a new queue_delayed_work(wq, work, delay) function and a new
schedule_delayed_work(work, delay) function. The later one is used to
correctly fix former tq_timer users. I've reverted those changes in 2.5.40
that changed tq_timer uses to schedule_work() - eg. in the case of
random.c or the tty flip queue it was definitely the wrong thing to do.
delayed work means a timer embedded in struct work_struct. I considered
using split struct work_struct and delayed_work_struct types, but lots
of code actively uses task-queues in both delayed and non-delayed mode,
so i went for the more generic approach that allows both methods of work
submission. Delayed timers do not cause any other overhead in the
normal submission path otherwise.
- multithreaded run_workqueue() implementation
the run_workqueue() function can now be called from multiple contexts, and
a worker thread will only use up a single entryy - this property is used
by the flushing code, and can potentially be used in the future to extend
the number of per-CPU worker threads.
- more reliable flushing
there's now a 'pending work' counter, which is used to accurately detect
when the last work-function has finished execution. It's also used to
correctly flush against timed requests. I'm not convinced whether the old
keventd implementation got this detail right.
- i switched the arguments of the queueing function(s) per Jeff's
suggestion, it's more straightforward this way.
Driver fixes:
i have converted almost every affected driver to the new framework. This
cleaned up tons of code. I also fixed a number of drivers that were still
using BHs (these drivers did not compile in 2.5.40).
while this means lots of changes, it might ease the QA decision whether to
put this patch into 2.5.
The pach converts roughly 80% of all tqueue-using code to workqueues - and
all the places that are not converted to workqueues yet are places that do
not compile in vanilla 2.5.40 anyway, due to unrelated changes. I've
converted a fair number of drivers that do not compile in 2.5.40, and i
think i've managed to convert every driver that compiles under 2.5.40.
Diffstat (limited to 'drivers/char/ip2')
| -rw-r--r-- | drivers/char/ip2/i2ellis.h | 2 | ||||
| -rw-r--r-- | drivers/char/ip2/i2lib.c | 6 | ||||
| -rw-r--r-- | drivers/char/ip2/i2lib.h | 7 |
3 files changed, 7 insertions, 8 deletions
diff --git a/drivers/char/ip2/i2ellis.h b/drivers/char/ip2/i2ellis.h index e6754e8127ec..72984869bea3 100644 --- a/drivers/char/ip2/i2ellis.h +++ b/drivers/char/ip2/i2ellis.h @@ -401,7 +401,7 @@ typedef struct _i2eBordStr rwlock_t write_fifo_spinlock; // For queuing interupt bottom half handlers. /\/\|=mhw=|\/\/ - struct tq_struct tqueue_interrupt; + struct work_struct tqueue_interrupt; struct timer_list SendPendingTimer; // Used by iiSendPending unsigned int SendPendingRetry; diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c index 4955f59d2eda..3d3711c1eff2 100644 --- a/drivers/char/ip2/i2lib.c +++ b/drivers/char/ip2/i2lib.c @@ -1582,8 +1582,7 @@ i2StripFifo(i2eBordStrPtr pB) WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); #ifdef USE_IQ - queue_task(&pCh->tqueue_input, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&pCh->tqueue_input); #else do_input(pCh); #endif @@ -1820,8 +1819,7 @@ i2StripFifo(i2eBordStrPtr pB) } /* End of switch on status type */ if (dss_change) { #ifdef USE_IQ - queue_task(&pCh->tqueue_status, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&pCh->tqueue_status); #else do_status(pCh); #endif diff --git a/drivers/char/ip2/i2lib.h b/drivers/char/ip2/i2lib.h index 44bc53bcec44..417a708c4ee1 100644 --- a/drivers/char/ip2/i2lib.h +++ b/drivers/char/ip2/i2lib.h @@ -27,6 +27,7 @@ #include "i2ellis.h" #include "i2pack.h" #include "i2cmd.h" +#include <linux/workqueue.h> //------------------------------------------------------------------------------ // i2ChanStr -- Channel Structure: @@ -224,9 +225,9 @@ typedef struct _i2ChanStr /* * Task queues for processing input packets from the board. */ - struct tq_struct tqueue_input; - struct tq_struct tqueue_status; - struct tq_struct tqueue_hangup; + struct work_struct tqueue_input; + struct work_struct tqueue_status; + struct work_struct tqueue_hangup; rwlock_t Ibuf_spinlock; rwlock_t Obuf_spinlock; |
