diff options
-rw-r--r-- | TAO/ChangeLog | 12 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp | 21 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h | 14 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp | 22 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h | 3 |
5 files changed, 65 insertions, 7 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index fdeca262f3f..b8a7439cd9f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,15 @@ +Mon Oct 11 10:26:59 2004 Venkita Subramonian <venkita@cs.wustl.edu> + + * orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.{cpp,h}: + * orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.{cpp,h}: + + Added utilization bound checking to the Reconfig scheduler. If + the total critical utilization exceeds the critical utilization + threshold or the total non-critical utilization exceeds the + non-critical utilization threshold, then the anomaly set is + filled with an appropriate error message. Thanks to + natodf@yahoo.com for pointing this out. + Sat Oct 9 19:03:53 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu> * tests/Typedef_String_Array/testImpl.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp index fbe66a8a334..6c64ca69c56 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp @@ -921,6 +921,8 @@ TAO_Tuple_Admission_Visitor (const CORBA::Double & critical_utilization_threshol const CORBA::Double & noncritical_utilization_threshold) : critical_utilization_ (0.0), noncritical_utilization_ (0.0), + total_critical_utilization_ (0.0), + total_noncritical_utilization_ (0.0), critical_utilization_threshold_ (critical_utilization_threshold), noncritical_utilization_threshold_ (noncritical_utilization_threshold) { @@ -971,6 +973,8 @@ TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::visit (TAO_RT_Info_Tuple & if (RECONFIG_SCHED_STRATEGY::is_critical (t)) { + this->total_critical_utilization_ += delta_utilization; + if (this->critical_utilization_ + this->noncritical_utilization_ +delta_utilization < this->critical_utilization_threshold_) @@ -982,6 +986,7 @@ TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::visit (TAO_RT_Info_Tuple & } else { + this->total_noncritical_utilization_ += delta_utilization; if (this->critical_utilization_ + this->noncritical_utilization_ +delta_utilization < this->noncritical_utilization_threshold_) @@ -991,7 +996,6 @@ TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::visit (TAO_RT_Info_Tuple & entry->actual_rt_info ()->period = t.period; } } - return 0; } @@ -1013,6 +1017,21 @@ TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::noncritical_utilization () return this->noncritical_utilization_; } +template <class RECONFIG_SCHED_STRATEGY> CORBA::Double +TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::total_critical_utilization () +{ + return this->total_critical_utilization_; +} + + +// Accessor for utilization by noncritical operations. + +template <class RECONFIG_SCHED_STRATEGY> CORBA::Double +TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::total_noncritical_utilization () +{ + return this->total_noncritical_utilization_; +} + // Accessor for utilization threshold for critical operations. template <class RECONFIG_SCHED_STRATEGY> CORBA::Double diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h index 9ea96225a4c..e1d29a51d88 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h @@ -246,7 +246,7 @@ public: (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map, ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map); // Constructor. - + protected: virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry, @@ -416,6 +416,12 @@ public: CORBA::Double noncritical_utilization_threshold (); // Accessor for utilization by noncritical operations. + CORBA::Double total_critical_utilization (); + // Accessor for utilization by critical operations. + + CORBA::Double total_noncritical_utilization (); + // Accessor for utilization by noncritical operations. + private: CORBA::Double critical_utilization_; @@ -424,6 +430,12 @@ private: CORBA::Double noncritical_utilization_; // Utilization by noncritical operations. + CORBA::Double total_critical_utilization_; + // Utilization by critical operations. + + CORBA::Double total_noncritical_utilization_; + // Utilization by noncritical operations. + CORBA::Double critical_utilization_threshold_; // Utilization by critical operations. diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp index a6a16be05f2..fd8d12992b6 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp @@ -1434,7 +1434,6 @@ recompute_scheduling (CORBA::Long minimum_priority, } - // @@ TODO: record any scheduling anomalies in a set within the scheduler, // storing the maximum severity level recorded so far. if (anomalies.ptr () == 0) @@ -1445,6 +1444,19 @@ recompute_scheduling (CORBA::Long minimum_priority, ACE_CHECK; } + ACE_DEBUG ((LM_DEBUG, + "cutil = %f, ncutil = %f\n", + this->critical_utilization_, + this->noncritical_utilization_)); + + if (this->critical_utilization_ > critical_utilization_threshold_ || + this->noncritical_utilization_ > noncritical_utilization_threshold_) + { + CORBA::ULong len = anomalies->length (); + anomalies->length (len + 1); + anomalies[len].description = CORBA::string_dup("Utilization Bound exceeded"); + anomalies[len].severity = RtecScheduler::ANOMALY_ERROR; + } // Set stability flags last. this->stability_flags_ = SCHED_ALL_STABLE; @@ -2538,7 +2550,8 @@ detect_cycles_i (ACE_ENV_SINGLE_ARG_DECL) template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>:: perform_admission_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, + ACE_THROW_SPEC ((RtecScheduler::UTILIZATION_BOUND_EXCEEDED, + CORBA::SystemException, RtecScheduler::INTERNAL)) { #if defined (SCHEDULER_LOGGING) @@ -2590,11 +2603,12 @@ perform_admission_i (ACE_ENV_SINGLE_ARG_DECL) } } + // Store the values accumulated by the visitor. this->noncritical_utilization_ = - admit_visitor.noncritical_utilization (); + admit_visitor.total_noncritical_utilization (); this->critical_utilization_ = - admit_visitor.critical_utilization (); + admit_visitor.total_critical_utilization (); } template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h index 1bba80973f5..c44f43abe39 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h @@ -598,7 +598,8 @@ protected: // checks for loops, marks unresolved remote dependencies. void perform_admission_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, + ACE_THROW_SPEC ((RtecScheduler::UTILIZATION_BOUND_EXCEEDED, + CORBA::SystemException, RtecScheduler::INTERNAL)); // Compute aggregate execution times, then performs admission over // rate tuples. |