From 9765eaebc4ffb1f1bdf6998c0491d2e37de1a994 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Thu, 3 Mar 2011 00:17:19 -0500 Subject: Kludge work-queue processing into klitirqd. NEEDS TESTING! --- include/linux/workqueue.h | 17 +++++++++++++++++ include/litmus/litmus_softirq.h | 24 +++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 25e02c941bac..a5c6cd3210be 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -83,6 +83,9 @@ struct work_struct { #ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map; #endif +#ifdef CONFIG_LITMUS_SOFTIRQD + struct task_struct *owner; +#endif }; #define WORK_DATA_INIT() ATOMIC_LONG_INIT(WORK_STRUCT_NO_CPU) @@ -115,11 +118,25 @@ struct execute_work { #define __WORK_INIT_LOCKDEP_MAP(n, k) #endif +#ifdef CONFIG_LITMUS_SOFTIRQD +#define __WORK_INIT_OWNER() \ + .owner = NULL, + +#define PREPARE_OWNER(_work, _owner) \ + do { \ + (_work)->owner = (_owner); \ + } while(0) +#else +#define __WORK_INIT_OWNER() +#define PREPARE_OWNER(_work, _owner) +#endif + #define __WORK_INITIALIZER(n, f) { \ .data = WORK_DATA_STATIC_INIT(), \ .entry = { &(n).entry, &(n).entry }, \ .func = (f), \ __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ + __WORK_INIT_OWNER() \ } #define __DELAYED_WORK_INITIALIZER(n, f) { \ diff --git a/include/litmus/litmus_softirq.h b/include/litmus/litmus_softirq.h index 712c8119ae15..e130a26685a2 100644 --- a/include/litmus/litmus_softirq.h +++ b/include/litmus/litmus_softirq.h @@ -2,6 +2,7 @@ #define __LITMUS_SOFTIRQ_H #include +#include /* Threaded tasklet handling for Litmus. Tasklets @@ -105,4 +106,25 @@ static inline void litmus_tasklet_hi_schedule_first( __litmus_tasklet_hi_schedule_first(t, k_id); } -#endif \ No newline at end of file +////////////// + +extern void __litmus_schedule_work( + struct work_struct* w, + unsigned int k_id); + +static inline void litmus_schedule_work( + struct work_struct* w, + unsigned int k_id) +{ + __litmus_schedule_work(w, k_id); +} + +#endif + + + + + + + + -- cgit v1.2.2