aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-09-27 13:33:03 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2014-02-19 15:33:39 -0500
commite01b6a8b49bf5c8f3a53b260b9d625a2321e4f42 (patch)
tree11de0f4a4429d3ebfd314fc1abcc74c0262eed45 /litmus
parent83057ba7c2d4916e54c71efe80f086adfab08f13 (diff)
PGM support in GSN-EDF.
Patch enables PGM support by GSN-EDF. GSN-EDF boosts the priority of a job waiting for inbound tokens. Likewise, boosting is removed when inbound tokens have been received.
Diffstat (limited to 'litmus')
-rw-r--r--litmus/sched_gsn_edf.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index 34e6cff9753e..b819b62915f1 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -28,10 +28,13 @@
28#ifdef CONFIG_SCHED_CPU_AFFINITY 28#ifdef CONFIG_SCHED_CPU_AFFINITY
29#include <litmus/affinity.h> 29#include <litmus/affinity.h>
30#endif 30#endif
31
32/* to set up domain/cpu mappings */ 31/* to set up domain/cpu mappings */
33#include <litmus/litmus_proc.h> 32#include <litmus/litmus_proc.h>
34 33
34#ifdef CONFIG_SCHED_PGM
35#include <litmus/pgm.h>
36#endif
37
35#include <linux/module.h> 38#include <linux/module.h>
36 39
37/* Overview of GSN-EDF operations. 40/* Overview of GSN-EDF operations.
@@ -461,6 +464,42 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev)
461 TRACE_TASK(prev, "will be preempted by %s/%d\n", 464 TRACE_TASK(prev, "will be preempted by %s/%d\n",
462 entry->linked->comm, entry->linked->pid); 465 entry->linked->comm, entry->linked->pid);
463 466
467#ifdef CONFIG_SCHED_PGM
468 if (exists && is_pgm_waiting(entry->scheduled)) {
469 if (!is_priority_boosted(entry->scheduled)) {
470 TRACE_TASK(entry->scheduled, "is waiting for PGM tokens.\n");
471 BUG_ON(is_pgm_satisfied(entry->scheduled));
472
473 /* Boost priority so we'll be scheduled immediately
474 when needed tokens arrive. */
475 tsk_rt(entry->scheduled)->priority_boosted = 1;
476 tsk_rt(entry->scheduled)->boost_start_time = litmus_clock();
477
478 if (unlikely(!blocks)) {
479 /* Task has probably blocked on an inbound token socket, but
480 if not, re-evaluate scheduling decisions */
481 unlink(entry->scheduled);
482 gsnedf_job_arrival(entry->scheduled);
483 }
484 }
485 else if (is_pgm_satisfied(entry->scheduled)) {
486 TRACE_TASK(entry->scheduled, "is done waiting for PGM tokens.\n");
487 BUG_ON(!is_priority_boosted(entry->scheduled));
488
489 /* clear any boosting */
490 tsk_rt(entry->scheduled)->priority_boosted = 0;
491 setup_pgm_release(entry->scheduled);
492
493 if (likely(!blocks)) {
494 /* Task has probably called sched_yield(), so blocking is
495 unlikely. Re-evaluate scheduling decisions because we
496 still want to run. */
497 unlink(entry->scheduled);
498 gsnedf_job_arrival(entry->scheduled);
499 }
500 }
501 }
502#endif
464 503
465 /* If a task blocks we have no choice but to reschedule. 504 /* If a task blocks we have no choice but to reschedule.
466 */ 505 */