Differences between revisions 1 and 2
Revision 1 as of 2012-08-14 10:32:08
Size: 1342
Editor: bbb
Comment:
Revision 2 as of 2014-06-12 15:17:38
Size: 1439
Editor: bbb
Comment:
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
Since `DEMO` implements a partitioned scheduler, we require that real-time tasks have migrated to the appropriated core ''before'' they become real-time tasks. This constraint simplifies the implementation of the plugin greatly and is not difficult to support in userspace (`liblitmus` contains a helper function `be_migrate_to()` that can take care of this requirement). Since `DEMO` implements a partitioned scheduler, we require that real-time tasks have migrated to the appropriated core ''before'' they become real-time tasks. This constraint simplifies the implementation of the plugin greatly and is not difficult to support in userspace (`liblitmus` contains a helper function `be_migrate_to_domain()` that can take care of this requirement, see below).
Line 22: Line 22:
== Testing == The plugin is now fully functional by itself. However, `liblitmus` contains code to make migrating tasks to the right processors (or clusters of processors) easier, and this support code requires additional information from the plugin. In the next step, the plugin is changed to export the required information.
Line 24: Line 24:
With this change in place, the plugin should be fully functional.
 1. Compile and boot the kernel
 2. Select the `DEMO` plugin with `setsched`.
 3. Launch some real-time tasks (e.g., with `rtspin` or `rt_launch`, which are both part of `liblitmus`).
On to the [[../Step9|next step]].

Admit Real-Time Tasks

The final step before the plugin can be used to schedule real-time tasks, we are going to change to demo_admit_task() callback to allow tasks, provided that they are located on the right core.

To this end, change demo_admit_task() to look as follows:

   1 static long demo_admit_task(struct task_struct *tsk)
   2 {
   3         if (task_cpu(tsk) == get_partition(tsk)) {
   4                 TRACE_TASK(tsk, "accepted by demo plugin.\n");
   5                 return 0;
   6         } else
   7                 return -EINVAL;
   8 }

Since DEMO implements a partitioned scheduler, we require that real-time tasks have migrated to the appropriated core before they become real-time tasks. This constraint simplifies the implementation of the plugin greatly and is not difficult to support in userspace (liblitmus contains a helper function be_migrate_to_domain() that can take care of this requirement, see below).

Note that task_cpu(tsk) is Linux's notion of where the task currently is, whereas get_partition(tsk) is LITMUSRT's notion of where the task is (logically) assigned to.

The plugin is now fully functional by itself. However, liblitmus contains code to make migrating tasks to the right processors (or clusters of processors) easier, and this support code requires additional information from the plugin. In the next step, the plugin is changed to export the required information.

On to the next step.

CreateAPluginTutorial/Step8 (last edited 2014-06-12 15:17:38 by bbb)