sys/src/rse.c File Reference

report system event More...

#include <linux/sched.h>
#include <asmlink.h>
#include <asm/hw_irq.h>
#include <sysgen.h>
#include <rse.h>
#include <pridef.h>
#include <evtdef.h>
#include <statedef.h>
#include <cpudef.h>
#include <system_data_cells.h>
#include <ipl.h>
#include <internals.h>
#include <exe_routines.h>
#include <sch_routines.h>
#include <smp_routines.h>
#include <misc_routines.h>
#include <queue.h>
#include <ipldef.h>
#include <cpbdef.h>

Go to the source code of this file.

Functions

void sch_unwait (struct _pcb *p)
void sch_rse (struct _pcb *p, unsigned char class, unsigned char event)
 event reporting - see 5.2 12.5.5
void sch_swpwake (void)
void sch_chsep (struct _pcb *p, unsigned char newpri)
 change pri state etc according to priclass etc - see 5.2 12.5.5
void sch_change_cur_priority (struct _pcb *p, unsigned char newpri)
 change process priority - see 5.2 12.5.3
int sch_qend (struct _pcb *p)
int sch_pixscan (void)
 pixscan priority boots - see 5.2 12.5.6
void sch_chse (struct _pcb *p, unsigned char class)
 change pri state etc according to priclass etc - see 5.2 12.5.5
void sch_wake (unsigned long pid)
 set wake and report it - see 5.2 13.3.1
void sch_one_sec (void)
 run once in a sec
int sch_waitm (struct _pcb *p, struct _wqh *wq)
int sch_waitl (struct _pcb *p, struct _wqh *wq)
int sch_waitk (struct _pcb *p, struct _wqh *wq)
int sch_wait (struct _pcb *p, struct _wqh *wq)
void sch_chsep2 (struct _pcb *p, unsigned char newpri)
void sch_chse2 (struct _pcb *p, unsigned char class)

Variables

int mydebug
int myp3
int myp2
int mycomq
int mypri
int sqfl


Detailed Description

report system event

Author:
Roar Thronęs

Definition in file rse.c.


Function Documentation

void sch_change_cur_priority ( struct _pcb *  p,
unsigned char  newpri 
)

change process priority - see 5.2 12.5.3

clear old pri bit in cpu_priority

if no other at same pri, clear bit in active_priority

copy new pri to cur_pri and pri

set new pri bit in cpu_priority

set corresponding bit in active_priority

find lsb in comqs

compare with newpri, and return if bigger

otherwise, request resched softint, locally or by intercpu interrupt

Definition at line 510 of file rse.c.

References _pcb, _cpu::cpu_b_cur_pri, CPU_M_RESCHED, sch_al_cpu_priority, sch_gl_active_priority, sch_gl_comqs, sch_gl_idle_cpus, smp_gl_cpu_data, and smp_send_work().

Referenced by exe_resched(), exe_setpri(), sch_lockr(), sch_lockw(), sch_qend(), and sch_unlock().

void sch_chse ( struct _pcb *  p,
unsigned char  class 
)

change pri state etc according to priclass etc - see 5.2 12.5.5

do pri adjustments

Definition at line 285 of file rse.c.

References PRI__IOCOM, PRI__NULL, PRI__RESAVL, PRI__TICOM, PRI__TIMER, PRI__TOCOM, and sch_chsep().

Referenced by exe_creprc(), sch_rse(), sch_std_ravail(), and sch_unlock().

void sch_chse2 ( struct _pcb *  p,
unsigned char  class 
)

Definition at line 676 of file rse.c.

References PRI__IOCOM, PRI__NULL, PRI__RESAVL, PRI__TICOM, PRI__TIMER, PRI__TOCOM, and sch_chsep2().

void sch_chsep ( struct _pcb *  p,
unsigned char  newpri 
)

change pri state etc according to priclass etc - see 5.2 12.5.5

set comqs or comoqs bits

if now computable process is outswapped... - MISSING

if resident, change state to COM

do affinities

insert into comq

Definition at line 158 of file rse.c.

References _pcb, CPU_M_RESCHED, ctl_gl_pcb, mycheckaddr(), mycomq, myp2, myp3, mypri, sch_al_cpu_priority, sch_aq_comh, sch_aq_comoh, sch_aq_comot, sch_aq_comt, sch_gl_active_priority, sch_gl_capability_sequence, sch_gl_comoqs, sch_gl_comqs, sch_gl_idle_cpus, sch_swpwake(), smp_send_work(), SPIN_SCHED, _spl::spl_l_spinlock, sqfl, and task_on_comqueue().

Referenced by sch_chse(), and sch_pixscan().

void sch_chsep2 ( struct _pcb *  p,
unsigned char  newpri 
)

Definition at line 628 of file rse.c.

References _pcb, mycheckaddr(), sch_aq_comh, sch_aq_comt, sch_gl_comqs, SPIN_SCHED, and _spl::spl_l_spinlock.

Referenced by sch_chse2().

void sch_one_sec ( void   ) 

run once in a sec

mainly run pixscan

Definition at line 551 of file rse.c.

References sch_pixscan().

Referenced by exe_timeout().

int sch_pixscan ( void   ) 

pixscan priority boots - see 5.2 12.5.6

test sgn pixscan and maybe return

get sched spinlock

determine if any processes eligible for boost, use comq and comoq

if none, return

compute highest pri of these two - MISSING

not implement this yet - MISSING actually partially in place

use abstim bit as coin - MISSING

scan queues

continue until max reached or max boosts reached

and DORMANTWAIT reached

compare onqtime dormantwait abstim_tics

set loworder bits in pixhist if found

if found, boost

release spinlock

Definition at line 97 of file rse.c.

References _pcb, sch_aq_comh, sch_chsep(), sch_gl_comqs, sgn_gw_pixscan, and SPIN_SCHED.

Referenced by sch_one_sec().

int sch_qend ( struct _pcb *  p  ) 

void sch_rse ( struct _pcb *  p,
unsigned char  class,
unsigned char  event 
)

event reporting - see 5.2 12.5.5

Parameters:
p pcb
class priority class
event type of event

based on current pcb state, check if event is significant for the process

AST events are signicant to almost all states except SUSPs, COMs, CUR

result in COM or COMO

wake is only signicant for HIBs

swapout is only significant for COM HIB LEF SUSP

else ignore and return

test for cef resident

for the most

if to be computable - MISSING

remove from waitqueue - MISSING actually commented out for some earlier(?) serious reason

adjust waitqueue count

adjust pcb onqtime

do priority adjustment, set to COM etc

for swapout

for non-COM

remove from resident wait queue

adjust waitqueue count

insert into outswapped wait queue

set state

adjust waitqueue count

for COM

remove from COM pri queue

if com pri queue empty, clear sch_gl_comqs bit

set state

set bit in sch_gl_comoqs

insert into COMO wait queue

Definition at line 346 of file rse.c.

References _pcb, EVT__AST, EVT__CEF, EVT__EVENT, EVT__FPGA, EVT__LEFO, EVT__PFCOM, EVT__RESUME, EVT__SETPRI, EVT__SWPOUT, EVT__WAKE, mycheckaddr(), sch_aq_comh, sch_aq_comoh, sch_aq_comot, sch_aq_wqhdr, SCH_C_COM, SCH_C_COMO, SCH_C_CUR, SCH_C_HIB, SCH_C_HIBO, SCH_C_LEF, SCH_C_SUSP, SCH_C_SUSPO, sch_chse(), sch_gl_comoqs, sch_gl_comqs, sch_unwait(), SPIN_SCHED, and _spl::spl_l_spinlock.

Referenced by exe_resume(), exe_setpri(), sch_qast(), sch_waitm(), sch_wake(), waitcheck(), and waitcheck2().

void sch_swpwake ( void   ) 

Definition at line 327 of file rse.c.

References sch_gl_comoqs, sch_gl_mfycnt, and sch_wake().

Referenced by exe_timeout(), and sch_chsep().

void sch_unwait ( struct _pcb *  p  ) 

Definition at line 703 of file rse.c.

Referenced by sch_rse().

int sch_wait ( struct _pcb *  p,
struct _wqh wq 
)

Definition at line 623 of file rse.c.

References sch_waitk().

Referenced by exe_hiber(), exe_std_iorsnwait(), and exe_wait().

int sch_waitk ( struct _pcb *  p,
struct _wqh wq 
)

Definition at line 597 of file rse.c.

References _pcb, qhead_init(), sch_gl_comqs, sch_waitl(), task_on_comqueue(), _wqh::wqh_l_wqcnt, and _wqh::wqh_l_wqfl.

Referenced by sch_wait().

int sch_waitl ( struct _pcb *  p,
struct _wqh wq 
)

Definition at line 592 of file rse.c.

References sch_waitm().

Referenced by mutexwait(), and sch_waitk().

int sch_waitm ( struct _pcb *  p,
struct _wqh wq 
)

Definition at line 556 of file rse.c.

References sch_rse(), and sch_sched().

Referenced by sch_waitl().

void sch_wake ( unsigned long  pid  ) 

set wake and report it - see 5.2 13.3.1

set pending wake flag

report wake scheduling event

Definition at line 318 of file rse.c.

References _pcb, exe_ipid_to_pcb(), and sch_rse().

Referenced by exe_qioacppkt(), exe_swtimint(), exe_wake(), and sch_swpwake().


Variable Documentation

int mycomq

Definition at line 152 of file rse.c.

Referenced by sch_chsep().

int mydebug

Definition at line 752 of file sched.c.

int myp2

Definition at line 152 of file rse.c.

Referenced by sch_chsep().

int myp3

Definition at line 152 of file rse.c.

Referenced by sch_chsep().

int mypri

Definition at line 152 of file rse.c.

Referenced by sch_chsep().

int sqfl

Definition at line 152 of file rse.c.

Referenced by sch_chsep().


Generated on Fri Oct 9 10:26:01 2009 for FreeVMS by  doxygen 1.5.5