kern: move `load` from Mach to Sys
This commit is contained in:
parent
2f850291d5
commit
75b451ea1c
|
@ -256,7 +256,6 @@ struct Mach
|
||||||
int pfault;
|
int pfault;
|
||||||
int cs;
|
int cs;
|
||||||
int syscall;
|
int syscall;
|
||||||
int load;
|
|
||||||
int intr;
|
int intr;
|
||||||
int mmuflush; /* make current proc flush it's mmu state */
|
int mmuflush; /* make current proc flush it's mmu state */
|
||||||
int ilockdepth;
|
int ilockdepth;
|
||||||
|
@ -324,6 +323,8 @@ struct Sys
|
||||||
unsigned int pipeqsize; /* size in bytes of pipe queues */
|
unsigned int pipeqsize; /* size in bytes of pipe queues */
|
||||||
int nuart; /* number of uart devices */
|
int nuart; /* number of uart devices */
|
||||||
|
|
||||||
|
int load;
|
||||||
|
|
||||||
char* architecture;
|
char* architecture;
|
||||||
uint64_t ticks;
|
uint64_t ticks;
|
||||||
Mach* machptr[MACHMAX];
|
Mach* machptr[MACHMAX];
|
||||||
|
|
|
@ -964,7 +964,7 @@ consread(Chan *c, void *buf, long n, int64_t off)
|
||||||
bp += NUMSIZE;
|
bp += NUMSIZE;
|
||||||
readnum(0, bp, NUMSIZE, mp->tlbpurge, NUMSIZE);
|
readnum(0, bp, NUMSIZE, mp->tlbpurge, NUMSIZE);
|
||||||
bp += NUMSIZE;
|
bp += NUMSIZE;
|
||||||
readnum(0, bp, NUMSIZE, mp->load, NUMSIZE);
|
readnum(0, bp, NUMSIZE, sys->load, NUMSIZE);
|
||||||
bp += NUMSIZE;
|
bp += NUMSIZE;
|
||||||
readnum(0, bp, NUMSIZE,
|
readnum(0, bp, NUMSIZE,
|
||||||
(mp->perf.avg_inidle*100)/mp->perf.period,
|
(mp->perf.avg_inidle*100)/mp->perf.period,
|
||||||
|
|
|
@ -291,7 +291,7 @@ reprioritize(Proc *p)
|
||||||
{
|
{
|
||||||
int fairshare, n, load, ratio;
|
int fairshare, n, load, ratio;
|
||||||
|
|
||||||
load = sys->machptr[0]->load;
|
load = sys->load;
|
||||||
if(load == 0)
|
if(load == 0)
|
||||||
return p->basepri;
|
return p->basepri;
|
||||||
|
|
||||||
|
@ -1780,5 +1780,5 @@ accounttime(void)
|
||||||
n = nrun;
|
n = nrun;
|
||||||
nrun = 0;
|
nrun = 0;
|
||||||
n = (nrdy+n)*1000;
|
n = (nrdy+n)*1000;
|
||||||
m->load = (m->load*(HZ-1)+n)/HZ;
|
sys->load = (sys->load*(HZ-1)+n)/HZ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue