public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* [patch][rfa] "active" pin of sid-sched
@ 2003-10-21 17:14 Dave Brolley
  2003-10-21 17:28 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Brolley @ 2003-10-21 17:14 UTC (permalink / raw)
  To: sid

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi,

This patch modifies the sid-sched compont so that it only drives its 
'active' pin when the threshold from being active to inactive is 
crossed. This is mainly an optimization.

ok to commit?

Dave

[-- Attachment #2: sched.ChangeLog --]
[-- Type: text/plain, Size: 424 bytes --]

2003-08-29  Dave Brolley  <brolley@redhat.com>

	* compSched.cxx (operator <<): Stream active_pin.
	(operator >>): Ditto.
	(active_pin): New member of scheduler_component.
	(advance): Drive active_pin with 1 or 0 as the enable
	threshold is crossed.
	(scheduler_component): Add "active_pin".
	(sid-sched.xml): Document "active" pin and interaction between
	"enabled?" and "enable-threshold".
	(sid-sched.txt): Regenerated.


[-- Attachment #3: sched.patch.txt --]
[-- Type: text/plain, Size: 4432 bytes --]

Index: sid/component/sched/compSched.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/sched/compSched.cxx,v
retrieving revision 1.11
diff -c -p -r1.11 compSched.cxx
*** sid/component/sched/compSched.cxx	29 Aug 2003 20:22:01 -0000	1.11
--- sid/component/sched/compSched.cxx	21 Oct 2003 17:03:57 -0000
*************** operator << (ostream& o, const scheduler
*** 1215,1220 ****
--- 1215,1221 ----
    o << "scheduler-state "
      << it.enable_threshold << " "
      << it.enable_p << " "
+     << it.active_p << " "
      << it.yield_host_time_threshold << " "
      << it.yield_host_time_p << " "
      << it.sched.step_cycle_limit << " "   // this is a component attribute
*************** operator >> (istream& i, scheduler_compo
*** 1261,1266 ****
--- 1262,1268 ----
      {
        i >> it.enable_threshold
          >> it.enable_p
+         >> it.active_p
  	>> it.yield_host_time_threshold
  	>> it.yield_host_time_p
  	>> it.sched.step_cycle_limit
*************** class scheduler_component: public schedu
*** 1335,1340 ****
--- 1337,1343 ----
    int enable_p;
    int yield_host_time_threshold;
    int yield_host_time_p;
+   bool active_p;
    host_int_8 advance_count;
    callback_pin<this_t> advance_pin;
    callback_pin<this_t> time_query_pin;
*************** protected:
*** 1396,1403 ****
  	       << this->yield_host_time_threshold << endl;
  #endif
  	  // Drive the active pin if the threshold has been crossed.
! 	  if (this->active_pin.recall() != 1)
! 	    this->active_pin.drive(1);
  
            this->advance_count ++;
    	  this->sched.advance (this->yield_host_time_p >= this->yield_host_time_threshold);
--- 1399,1409 ----
  	       << this->yield_host_time_threshold << endl;
  #endif
  	  // Drive the active pin if the threshold has been crossed.
! 	  if (UNLIKELY(! this->active_p))
! 	    {
! 	      this->active_pin.drive (1);
! 	      this->active_p = true;
! 	    }
  
            this->advance_count ++;
    	  this->sched.advance (this->yield_host_time_p >= this->yield_host_time_threshold);
*************** protected:
*** 1405,1412 ****
        else
  	{
  	  // Drive the active pin if the threshold has been crossed.
! 	  if (this->active_pin.recall() != 0)
! 	    this->active_pin.drive(0);
  	}
      }
  
--- 1411,1421 ----
        else
  	{
  	  // Drive the active pin if the threshold has been crossed.
! 	  if (UNLIKELY(this->active_p))
! 	    {
! 	      this->active_pin.drive (0);
! 	      this->active_p = false;
! 	    }
  	}
      }
  
*************** public:
*** 1444,1450 ****
      clients(0),
      num_clients(0),
      enable_threshold(1),
!     enable_p(1),
      yield_host_time_threshold(1), 
      yield_host_time_p(0), 
      advance_count(0),
--- 1453,1459 ----
      clients(0),
      num_clients(0),
      enable_threshold(1),
!     active_p(1),
      yield_host_time_threshold(1), 
      yield_host_time_p(0), 
      advance_count(0),
*************** public:
*** 1452,1457 ****
--- 1461,1467 ----
      time_query_pin(this, & scheduler_component::time_query),
      yield_pin(this, & scheduler_component::yield_step_loop)
      {
+       enable_p = enable_threshold;
        scheduler_component_ctor_1();
        scheduler_component_ctor_2();
        scheduler_component_ctor_3();
Index: sid/component/sched/sid-sched.xml
===================================================================
RCS file: /cvs/src/src/sid/component/sched/sid-sched.xml,v
retrieving revision 1.5
diff -c -p -r1.5 sid-sched.xml
*** sid/component/sched/sid-sched.xml	29 Aug 2003 19:45:10 -0000	1.5
--- sid/component/sched/sid-sched.xml	21 Oct 2003 17:03:57 -0000
***************
*** 137,144 ****
  
      <behavior name="advancing">
        <p> When you have disabled the scheduler by setting the
!       <attribute>enabled?</attribute> attribute to a value less than enable-threshold,
!       advancing as described below, does not occur.
        </p>
  
        <p> Whenever the <pin>advance</pin> input pin is driven, the scheduler
--- 137,144 ----
  
      <behavior name="advancing">
        <p> When you have disabled the scheduler by setting the
!       <attribute>enabled?</attribute> attribute to a value less than the <attribute>enable-threshold</attribute>
!       attribute, advancing as described below, does not occur.
        </p>
  
        <p> Whenever the <pin>advance</pin> input pin is driven, the scheduler

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch][rfa] "active" pin of sid-sched
  2003-10-21 17:14 [patch][rfa] "active" pin of sid-sched Dave Brolley
@ 2003-10-21 17:28 ` Frank Ch. Eigler
  2003-10-21 18:09   ` Dave Brolley
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2003-10-21 17:28 UTC (permalink / raw)
  To: Dave Brolley; +Cc: sid

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

Hi -

> This patch modifies the sid-sched compont so that it only drives its 
> 'active' pin when the threshold from being active to inactive is 
> crossed. 

The existing ".recall()" check is already intended to do that, no?

> This is mainly an optimization.

Are you sure it helps?


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch][rfa] "active" pin of sid-sched
  2003-10-21 17:28 ` Frank Ch. Eigler
@ 2003-10-21 18:09   ` Dave Brolley
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Brolley @ 2003-10-21 18:09 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: sid

Frank Ch. Eigler wrote:

>Hi -
>
>  
>
>>This patch modifies the sid-sched compont so that it only drives its 
>>'active' pin when the threshold from being active to inactive is 
>>crossed. 
>>    
>>
>
>The existing ".recall()" check is already intended to do that, no?
>
Ahhh, yes. You are correct. I recall now (no pun intended) that we had 
discussed this earlier and you had suggested the recall method as a 
better implementation. Sorry for any confusion.

Dave


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-21 18:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-21 17:14 [patch][rfa] "active" pin of sid-sched Dave Brolley
2003-10-21 17:28 ` Frank Ch. Eigler
2003-10-21 18:09   ` Dave Brolley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).