kern: move `load` from Mach to Sys

This commit is contained in:
Giacomo Tesio 2020-02-17 00:19:03 +01:00
parent 2f850291d5
commit 75b451ea1c
3 changed files with 5 additions and 4 deletions

View File

@ -256,7 +256,6 @@ struct Mach
int pfault;
int cs;
int syscall;
int load;
int intr;
int mmuflush; /* make current proc flush it's mmu state */
int ilockdepth;
@ -324,6 +323,8 @@ struct Sys
unsigned int pipeqsize; /* size in bytes of pipe queues */
int nuart; /* number of uart devices */
int load;
char* architecture;
uint64_t ticks;
Mach* machptr[MACHMAX];

View File

@ -964,7 +964,7 @@ consread(Chan *c, void *buf, long n, int64_t off)
bp += NUMSIZE;
readnum(0, bp, NUMSIZE, mp->tlbpurge, NUMSIZE);
bp += NUMSIZE;
readnum(0, bp, NUMSIZE, mp->load, NUMSIZE);
readnum(0, bp, NUMSIZE, sys->load, NUMSIZE);
bp += NUMSIZE;
readnum(0, bp, NUMSIZE,
(mp->perf.avg_inidle*100)/mp->perf.period,

View File

@ -291,7 +291,7 @@ reprioritize(Proc *p)
{
int fairshare, n, load, ratio;
load = sys->machptr[0]->load;
load = sys->load;
if(load == 0)
return p->basepri;
@ -1780,5 +1780,5 @@ accounttime(void)
n = nrun;
nrun = 0;
n = (nrdy+n)*1000;
m->load = (m->load*(HZ-1)+n)/HZ;
sys->load = (sys->load*(HZ-1)+n)/HZ;
}