public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Dave Brolley <brolley@redhat.com>
To: sid@sources.redhat.com
Subject: [patch][rfa] "active" pin of sid-sched
Date: Tue, 21 Oct 2003 17:14:00 -0000	[thread overview]
Message-ID: <3F956986.6010803@redhat.com> (raw)

[-- 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

             reply	other threads:[~2003-10-21 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21 17:14 Dave Brolley [this message]
2003-10-21 17:28 ` Frank Ch. Eigler
2003-10-21 18:09   ` Dave Brolley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F956986.6010803@redhat.com \
    --to=brolley@redhat.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).