aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/tasklet.h
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-06-16 16:56:31 +0100
committerKeir Fraser <keir@xen.org>2011-06-16 16:56:31 +0100
commiteed054473d2c1d763ea4f1732cae2fa71534cafb (patch)
treee0613b1dbd533b0b631343e4cd2bfd63f9f737e0 /xen/include/xen/tasklet.h
parentf90382990285ff1267051c181f90531808c369ff (diff)
downloadxen-eed054473d2c1d763ea4f1732cae2fa71534cafb.tar.gz
xen-eed054473d2c1d763ea4f1732cae2fa71534cafb.tar.bz2
xen-eed054473d2c1d763ea4f1732cae2fa71534cafb.zip
tasklets: Allow tasklets to be created that run in softirq context.
Where this is safe, it can reduce latency and cpu overhead compared with scheduling the idle vcpu to perform the same tasklet work. Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen/tasklet.h')
-rw-r--r--xen/include/xen/tasklet.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/xen/include/xen/tasklet.h b/xen/include/xen/tasklet.h
index 2f65da2c4a..8c3de7e20e 100644
--- a/xen/include/xen/tasklet.h
+++ b/xen/include/xen/tasklet.h
@@ -1,8 +1,10 @@
/******************************************************************************
* tasklet.h
*
- * Tasklets are dynamically-allocatable tasks run in VCPU context
- * (specifically, the idle VCPU's context) on at most one CPU at a time.
+ * Tasklets are dynamically-allocatable tasks run in either VCPU context
+ * (specifically, the idle VCPU's context) or in softirq context, on at most
+ * one CPU at a time. Softirq versus VCPU context execution is specified
+ * during per-tasklet initialisation.
*/
#ifndef __XEN_TASKLET_H__
@@ -16,14 +18,20 @@ struct tasklet
{
struct list_head list;
int scheduled_on;
+ bool_t is_softirq;
bool_t is_running;
bool_t is_dead;
void (*func)(unsigned long);
unsigned long data;
};
-#define DECLARE_TASKLET(name, func, data) \
- struct tasklet name = { LIST_HEAD_INIT(name.list), -1, 0, 0, func, data }
+#define _DECLARE_TASKLET(name, func, data, softirq) \
+ struct tasklet name = { \
+ LIST_HEAD_INIT(name.list), -1, softirq, 0, 0, func, data }
+#define DECLARE_TASKLET(name, func, data) \
+ _DECLARE_TASKLET(name, func, data, 0)
+#define DECLARE_SOFTIRQ_TASKLET(name, func, data) \
+ _DECLARE_TASKLET(name, func, data, 1)
/* Indicates status of tasklet work on each CPU. */
DECLARE_PER_CPU(unsigned long, tasklet_work_to_do);
@@ -38,6 +46,8 @@ void do_tasklet(void);
void tasklet_kill(struct tasklet *t);
void tasklet_init(
struct tasklet *t, void (*func)(unsigned long), unsigned long data);
+void softirq_tasklet_init(
+ struct tasklet *t, void (*func)(unsigned long), unsigned long data);
void tasklet_subsys_init(void);
#endif /* __XEN_TASKLET_H__ */