next contents previous
Next: dp_cntl (2) Up: contents Previous: creat (2)





DISPCNTL(2-N)              SYSTEM CALLS             DISPCNTL(2-N)


NAME
     dispcntl -- control of active process scheduling


SYNOPSIS
     #include <sys/types.h>
     #include <sys/disp.h>
     int dispcntl (sgkey_t sgkey, id_t id, int cmd, dispset_t (or
     dispset2_t) *addr);


DESCRIPTION
     To each value specified in addr,  dispcntl  sets/gets/resets
     the  scheduling  variables of the process specified in sgkey
     and id.

     At SUPER-UX R6.2, the scheduling parameter  is  added.  This
     parameter  restricts  the number of processors which process
     can use simultaneously (number  of  concurrent  processors).
     In  case  of  using  this parameter, please note that how to
     specify the arguments cmd, addr is changed.  (The LM  linked
     before  R6.2  use  this  system call can execute without re-
     linked.)

     The values specifiable in sgkey and their  explanations  are
     as follows.

          1.  SG_PID          id  is  a process id. When id is 0,
                              id is the calling process id.
          2.  SG_PPID         id is a parent process id. When  id
                              is  0,  id is the parent process id
                              of the calling process.
          3.  SG_PGID         id is a process  group  id.  It  is
                              impossible that id is 0.
          4.  SG_JID          id is a job id. When id is 0, id is
                              the job id of the calling  process.
          5.  SG_UID          id  is  a user id. When id is 0, id
                              is the user id of the calling  pro-
                              cess.
          6.  SG_GID          id  is a group id. When id is 0, id
                              is the group id of the calling pro-
                              cess.
          7.  SG_DSG          All processes in default scheduling
                              group. (id is invalid.)

     A calling process must be a  superuser  or  have  an  access
     right matching sgkey.

     The  values specifiable in cmd and their explanations are as
     follows.

          1.  DCNTL_GET       Gets   the   scheduling   variables
                              (except a number of concurrent pro-
                              cessors   parameter)   of   process



SUPER-UX            Last change: Jun 19, 1996                   1





DISPCNTL(2-N)              SYSTEM CALLS             DISPCNTL(2-N)


                              specified  in sgkey and id, to each
                              value specified in addr.
          2.  DCNTL_SET       Sets   the   scheduling   variables
                              (except a number of concurrent pro-
                              cessors parameter) of process spec-
                              ified  in  sgkey  and  id,  to each
                              value specified in addr.
          3.  DCNTL_RESET     Resets all of the scheduling  vari-
                              ables  of  process to each value of
                              default scheduling  group.(addr  is
                              invalid)
          4.  DCNTL_GET2      Gets  all  of  the scheduling vari-
                              ables of process specified in sgkey
                              and  id, to each value specified in
                              addr.
          5.  DCNTL_SET2      Sets all of  the  scheduling  vari-
                              ables of process specified in sgkey
                              and id, to each value specified  in
                              addr.

     A  scheduling  group is the set of processes having the same
     scheduling parameters; it can be specified with dispcntl.

     In order to create the scheduling group denoted by the sgkey
     and  the  id,  call  dispcntl with the DCNTL_SET (in case of
     using a number  of  concurrent  processors  parameter  also,
     DCNTL_SET2) command by specifying the sgkey and id.

     In  order  to obtain scheduling parameters of the scheduling
     group denoted by the sgkey and the id,  call  dispcntl  with
     the  DCNTL_GET (in case of using a number of concurrent pro-
     cessors parameter also, DCNTL_GET2)  command  by  specifying
     the  sgkey and id, this scheduling group must have been cre-
     ated before.

     With the DCNTL_RESET command,  scheduling  parameters  of  a
     scheduling  group  denoted by the sgkey and the id are reset
     to the parameters of the default scheduling group, and  this
     scheduling group is broken up.

     Though a number of concurrent processors parameter is added,
     the structure of dispset_t isn't changed in order to keep  a
     compatibility before R6.2.  Then the structure of dispset2_t
     is defined newly.  The structure of dispset2_t is defined as
     including  this  parameter  in addition to the parameters of
     dispset_t structure.

     (Remarks) If you  use  a  number  of  concurrent  processors
     parameter,  DCNTL_GET2  or DCNTL_SET2 command must be speci-
     fied at cmd and it is necessary to ensure the space  of  the
     structure dispset2_t and please cast an address of data into
     (dispset_t *), or warning message is output when  a  program
     is compiled.




SUPER-UX            Last change: Jun 19, 1996                   2





DISPCNTL(2-N)              SYSTEM CALLS             DISPCNTL(2-N)


     The dispset_t and dispset2_t structure is as follows:

        typedef struct dispset {
           int basepri;      /* Base priority */
           int modcpu;       /* Modification value of CPU counter
                             */
           int tickcnt;      /* Tick quantum */
           int dcyfctr;      /* Decay factor */
           int dcyintvl;     /* Decay interval */
           int tmslice;      /* Timeslice */
           int mempri;       /* Memory priority */
           int szefctmrt;    /* The effect coefficient of process
                             size to MRT */
           int priefctmrt;   /* The effect coefficient of process
                             memory scheduling priority to MRT */
           int minmrt;       /* Minimum value of MRT */
           int agrange;      /* Aging range */
           int spinherit     /*  Inheritance  times of scheduling
                             parameters */
        } dispset_t;



        typedef struct dispset2 {
           int basepri;      /* Base priority */
           int modcpu;       /* Modification value of CPU counter
                             */
           int tickcnt;      /* Tick quantum */
           int dcyfctr;      /* Decay factor */
           int dcyintvl;     /* Decay interval */
           int tmslice;      /* Timeslice */
           int mempri;       /* Memory priority */
           int szefctmrt;    /* The effect coefficient of process
                             size to MRT */
           int priefctmrt;   /* The effect coefficient of process
                             memory scheduling priority to MRT */
           int minmrt;       /* Minimum value of MRT */
           int agrange;      /* Aging range */
           int spinherit;    /* Inheritance times  of  scheduling
                             parameters */
           int concpu;       /* Concurrent processors */
        } dispset2_t;


     The ranges of the scheduling variables for the superuser are
     as follows.

               basepri     must be more than -20.
               modcpu      must be a non-negative integer.
               tickcnt     must be a non-negative  integer  (unit
                           is tick).
               dcyfctr     must  be an integer within the range 0
                           to 7.
               dcyintvl    must be a positive  integer  (unit  is



SUPER-UX            Last change: Jun 19, 1996                   3





DISPCNTL(2-N)              SYSTEM CALLS             DISPCNTL(2-N)


                           second).
               tmslice     must  be  a  positive integer (unit is
                           tick).
               mempri      must be a positive integer within  the
                           range 0 to 39.
               szefctmrt   must  be a positive integer within the
                           range 0 to 1000.
               priefctmrt  must be a positive integer within  the
                           range 20 to 1000.
               minmrt      must be a non-negative integer.
               agrange     must be a positive integer.
               spinherit   must be a non-negative integer.
               concpu      must be a positive integer and must be
                           an equal or smaller than 32.  (If  the
                           specified  value  is  larger  than the
                           available CPUs, the specified value is
                           corrected to the available CPUs.)

     The ranges of the variables for the general user are as fol-
     lows.

               basepri     must be an integer more  than  current
                           value.
               modcpu      must  be an integer within the range 0
                           to current value.
               tickcnt     must be an integer more  than  current
                           value.
               dcyfctr     must  be an integer within the range 0
                           to current value.
               dcyintvl    must be a positive integer.
               tmslice     must be an integer within the range  1
                           to 20.
               mempri      must  be  an  integer within the range
                           current value to 39.
               szefctmrt   must be an integer within the range  0
                           to current value.
               priefctmrt  must  be  an  integer within the range
                           current value to 1000.
               minmrt      must be the same as the current value.
               agrange     must  be  an integer more than current
                           value.
               spinherit   must be a non-negative integer.
               concpu      must be a positive integer and must be
                           an  equal  or smaller than the current
                           value.

     dispcntl terminates abnormally when at least one of the fol-
     lowing conditions is true:


     [ESRCH]   A process associated with id does not exist.


     [EINVAL]  cmd is invalid.



SUPER-UX            Last change: Jun 19, 1996                   4





DISPCNTL(2-N)              SYSTEM CALLS             DISPCNTL(2-N)


     [EPERM]   A calling process does not have an access right.


     [EFAULT]  addr points to invalid address.


SEE ALSO
     getdispinfo(2), setdispval(2)


DIAGNOSTICS
     Value  0  is  returned  when processing terminates normally.
     Otherwise, value -1 is returned and a value  indicating  the
     error is set in errno.











































SUPER-UX            Last change: Jun 19, 1996                   5




next contents previous
Next: dp_cntl (2) Up: contents Previous: creat (2)

G1AB02E Programmer's Reference Manual