Skip to contentSkip to conversation

PATCH Sebastian Andrzej Siewior 1 participant 1 message Feb 16, 2015 Scheduler

lore
Share & tools
lore
#0 lore raw

[email protected], [email protected]
Bcc:
Subject: [PATCH RT] work-simple: Simple work queue implemenation Reply-To:

This is swork patch which is in -RT since v3.18. Two users so far…

From: Daniel Wagner <[email protected]>

Provides a framework for enqueuing callbacks from irq context PREEMPT_RT_FULL safe. The callbacks are executed in kthread context.

Bases on wait-simple.

Cc Sebastian Andrzej Siewior <[email protected]>
---
 include/linux/work-simple.h |   24 ++++++
 kernel/sched/Makefile       |    2 
 kernel/sched/work-simple.c  |  176 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 201 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/work-simple.h
 create mode 100644 kernel/sched/work-simple.c
include/linux/work-simple.h new file +24 -0
@@ -0,0 +1,24 @@
+#ifndef _LINUX_SWORK_H
+#define _LINUX_SWORK_H
+
+#include <linux/list.h>
+
+struct swork_event {
+	struct list_head item;
+	unsigned long flags;
+	void (*func)(struct swork_event *);
+};
+
+static inline void INIT_SWORK(struct swork_event *event,
+			      void (*func)(struct swork_event *))
+{
+	event->flags = 0;
+	event->func = func;
+}
+
+bool swork_queue(struct swork_event *sev);
+
+int swork_get(void);
+void swork_put(void);
+
+#endif /* _LINUX_SWORK_H */
kernel/sched/Makefile +1 -1
@@ -13,7 +13,7 @@ endif
 
 obj-y += core.o proc.o clock.o cputime.o
 obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o
-obj-y += wait.o wait-simple.o completion.o idle.o
+obj-y += wait.o wait-simple.o work-simple.o completion.o idle.o
 obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o
 obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o
 obj-$(CONFIG_SCHEDSTATS) += stats.o
kernel/sched/work-simple.c new file +176 -0

176 lines not on this page · raw message