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 /include/linux/wanpipe.h | |
| 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 'include/linux/wanpipe.h')
| -rw-r--r-- | include/linux/wanpipe.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 061090a368f8..74b35ec9099c 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -320,7 +320,7 @@ typedef struct { #include <linux/sdladrv.h> /* SDLA support module API definitions */ #include <linux/sdlasfm.h> /* SDLA firmware module definitions */ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #ifdef LINUX_2_4 #include <linux/serial.h> #include <linux/serialP.h> @@ -389,7 +389,7 @@ typedef struct sdla unsigned int tty_open; unsigned char *tty_buf; unsigned char *tty_rx; - struct tq_struct tty_task_queue; + struct work_struct tty_work; union { @@ -422,7 +422,7 @@ typedef struct sdla u8 oob_on_modem; /* Option to send modem status to the api */ u16 num_of_ch; /* Number of channels configured by the user */ - struct tq_struct x25_poll_task; + struct work_struct x25_poll_work; struct timer_list x25_timer; } x; struct @@ -545,7 +545,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf); /* Sync PPP on top of RAW CH extern sdla_t * wanpipe_find_card(char *); extern sdla_t * wanpipe_find_card_num (int); -extern void wanpipe_queue_tq (struct tq_struct *); +extern void wanpipe_queue_work (struct work_struct *); extern void wanpipe_mark_bh (void); extern void wakeup_sk_bh (netdevice_t *); extern int change_dev_flags (netdevice_t *, unsigned); |
