diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-02-19 14:06:46 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-02-19 14:06:46 -0500 |
commit | a325fa8765ada38596feb419bc92a5990e04fc10 (patch) | |
tree | 42e8ca26bc83ec2239d4714ed7b010dab740c023 | |
parent | 07834c598e0edbabdb1898f92198fede73eefc64 (diff) | |
parent | e7c1feeb9f7beb971be3c79f0b236ada78955372 (diff) |
Merge branch 'master' of ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmus2010
-rw-r--r-- | litmus/sched_cedf.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index f37d5f67a308..d0767ce9e178 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c | |||
@@ -112,6 +112,8 @@ cpu_entry_t* *cedf_cpu_entries_array; | |||
112 | */ | 112 | */ |
113 | int cluster_size = 4; | 113 | int cluster_size = 4; |
114 | 114 | ||
115 | int do_cleanup = 1; | ||
116 | |||
115 | typedef struct { | 117 | typedef struct { |
116 | rt_domain_t domain; | 118 | rt_domain_t domain; |
117 | int first_cpu; | 119 | int first_cpu; |
@@ -667,6 +669,19 @@ static int __init init_cedf(void) | |||
667 | int cpu; | 669 | int cpu; |
668 | cpu_entry_t *entry; | 670 | cpu_entry_t *entry; |
669 | 671 | ||
672 | /* num_online_cpus() should have been set already | ||
673 | * if the number of available cpus is less then the cluster | ||
674 | * size (currently 4) then it is pointless trying to use | ||
675 | * CEDF, so we disable this plugin | ||
676 | */ | ||
677 | if(num_online_cpus() < cluster_size) { | ||
678 | printk(KERN_INFO "Not registering C-EDF plugin: " | ||
679 | "Num Online Cpus (%d) < Min Cluster Size (%d)\n", | ||
680 | num_online_cpus(), cluster_size); | ||
681 | do_cleanup = 0; | ||
682 | return 0; | ||
683 | } | ||
684 | |||
670 | /* | 685 | /* |
671 | * initialize short_cut for per-cpu cedf state; | 686 | * initialize short_cut for per-cpu cedf state; |
672 | * there may be a problem here if someone removes a cpu | 687 | * there may be a problem here if someone removes a cpu |
@@ -701,8 +716,10 @@ static int __init init_cedf(void) | |||
701 | 716 | ||
702 | static void clean_cedf(void) | 717 | static void clean_cedf(void) |
703 | { | 718 | { |
704 | kfree(cedf_cpu_entries_array); | 719 | if(do_cleanup) { |
705 | kfree(cedf_domains_array); | 720 | kfree(cedf_cpu_entries_array); |
721 | kfree(cedf_domains_array); | ||
722 | } | ||
706 | } | 723 | } |
707 | 724 | ||
708 | module_init(init_cedf); | 725 | module_init(init_cedf); |