Removed all code related to the pagescan daemon, and changed 'act_count'
adjustments to compensate for a world without the pagescan daemon.
This commit is contained in:
parent
4470f3d596
commit
0e87163cbf
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.24 1994/05/25 08:55:18 rgrimes Exp $
|
||||
* $Id: trap.c,v 1.26 1994/06/11 05:13:33 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -408,6 +408,8 @@ trap_pfault(frame, usermode)
|
||||
*(volatile char *)v += 0;
|
||||
|
||||
ptepg = (vm_page_t) pmap_pte_vm_page(vm_map_pmap(map), v);
|
||||
if( ptepg->hold_count == 0)
|
||||
ptepg->act_count += 3;
|
||||
vm_page_hold(ptepg);
|
||||
|
||||
/* Fault in the user page: */
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.24 1994/05/25 08:55:18 rgrimes Exp $
|
||||
* $Id: trap.c,v 1.26 1994/06/11 05:13:33 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -408,6 +408,8 @@ trap_pfault(frame, usermode)
|
||||
*(volatile char *)v += 0;
|
||||
|
||||
ptepg = (vm_page_t) pmap_pte_vm_page(vm_map_pmap(map), v);
|
||||
if( ptepg->hold_count == 0)
|
||||
ptepg->act_count += 3;
|
||||
vm_page_hold(ptepg);
|
||||
|
||||
/* Fault in the user page: */
|
||||
|
@ -81,7 +81,7 @@ struct filedesc0 filedesc0;
|
||||
struct plimit limit0;
|
||||
struct vmspace vmspace0;
|
||||
struct proc *curproc = &proc0;
|
||||
struct proc *initproc, *pageproc, *pagescanproc, *updateproc;
|
||||
struct proc *initproc, *pageproc, *updateproc;
|
||||
|
||||
int cmask = CMASK;
|
||||
extern struct user *proc0paddr;
|
||||
@ -299,24 +299,9 @@ main(framep)
|
||||
vm_pageout();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#if 1
|
||||
/*
|
||||
* Start page scanner daemon (process 3).
|
||||
*/
|
||||
if (fork(p, (void *) NULL, rval))
|
||||
panic("failed fork page scanner daemon");
|
||||
if (rval[1]) {
|
||||
p = curproc;
|
||||
pagescanproc = p;
|
||||
p->p_flag |= P_INMEM | P_SYSTEM;
|
||||
bcopy("pagescan", p->p_comm, sizeof("pagescan"));
|
||||
vm_pagescan();
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Start update daemon (process 4).
|
||||
* Start update daemon (process 3).
|
||||
*/
|
||||
#ifndef LAPTOP
|
||||
if (fork(p, (void *) NULL, rval))
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.24 1994/05/25 08:55:18 rgrimes Exp $
|
||||
* $Id: trap.c,v 1.26 1994/06/11 05:13:33 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -408,6 +408,8 @@ trap_pfault(frame, usermode)
|
||||
*(volatile char *)v += 0;
|
||||
|
||||
ptepg = (vm_page_t) pmap_pte_vm_page(vm_map_pmap(map), v);
|
||||
if( ptepg->hold_count == 0)
|
||||
ptepg->act_count += 3;
|
||||
vm_page_hold(ptepg);
|
||||
|
||||
/* Fault in the user page: */
|
||||
|
@ -1194,7 +1194,6 @@ swap_pager_input(swp, m, count, reqpage)
|
||||
* to deactivate the readahead pages.
|
||||
*/
|
||||
vm_page_deactivate(m[i]);
|
||||
m[i]->act_count = 2;
|
||||
|
||||
/*
|
||||
* just in case someone was asking for this
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
|
||||
* $Id: vm_page.c,v 1.17 1994/04/20 07:07:14 davidg Exp $
|
||||
* $Id: vm_page.c,v 1.2 1994/05/25 09:20:05 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -838,7 +838,7 @@ void vm_page_activate(m)
|
||||
m->flags |= PG_ACTIVE;
|
||||
TAILQ_REMOVE(&m->object->memq, m, listq);
|
||||
TAILQ_INSERT_TAIL(&m->object->memq, m, listq);
|
||||
m->act_count = 10;
|
||||
m->act_count = 1;
|
||||
cnt.v_active_count++;
|
||||
}
|
||||
splx(s);
|
||||
|
@ -65,7 +65,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_pageout.c,v 1.20 1994/04/20 07:07:15 davidg Exp $
|
||||
* $Id: vm_pageout.c,v 1.3 1994/06/06 11:56:27 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -102,7 +102,7 @@ extern int swap_pager_ready();
|
||||
#define MAXSCAN 512 /* maximum number of pages to scan in active queue */
|
||||
/* set the "clock" hands to be (MAXSCAN * 4096) Bytes */
|
||||
#define ACT_DECLINE 1
|
||||
#define ACT_ADVANCE 6
|
||||
#define ACT_ADVANCE 3
|
||||
#define ACT_MAX 300
|
||||
|
||||
#define LOWATER ((2048*1024)/NBPG)
|
||||
@ -724,88 +724,6 @@ rescan1:
|
||||
return force_wakeup;
|
||||
}
|
||||
|
||||
void
|
||||
vm_pagescan()
|
||||
{
|
||||
int maxscan, pages_scanned, pages_referenced, nextscan, scantick = hz/20;
|
||||
int m_ref, next_ref;
|
||||
vm_page_t m, next;
|
||||
|
||||
(void) spl0();
|
||||
|
||||
nextscan = scantick;
|
||||
|
||||
scanloop:
|
||||
|
||||
pages_scanned = 0;
|
||||
pages_referenced = 0;
|
||||
maxscan = min(cnt.v_active_count, MAXSCAN);
|
||||
|
||||
/*
|
||||
* Gather statistics on page usage.
|
||||
*/
|
||||
m = vm_page_queue_active.tqh_first;
|
||||
while (m && (maxscan-- > 0)) {
|
||||
|
||||
++pages_scanned;
|
||||
|
||||
next = m->pageq.tqe_next;
|
||||
|
||||
/*
|
||||
* Dont mess with pages that are busy.
|
||||
*/
|
||||
if ((m->flags & PG_BUSY) || (m->hold_count != 0)) {
|
||||
m = next;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Advance pages that have been referenced, decline pages that
|
||||
* have not.
|
||||
*/
|
||||
if (pmap_is_referenced(VM_PAGE_TO_PHYS(m))) {
|
||||
pmap_clear_reference(VM_PAGE_TO_PHYS(m));
|
||||
pages_referenced++;
|
||||
if (m->act_count < ACT_MAX)
|
||||
m->act_count += ACT_ADVANCE;
|
||||
TAILQ_REMOVE(&vm_page_queue_active, m, pageq);
|
||||
TAILQ_INSERT_TAIL(&vm_page_queue_active, m, pageq);
|
||||
TAILQ_REMOVE(&m->object->memq, m, listq);
|
||||
TAILQ_INSERT_TAIL(&m->object->memq, m, listq);
|
||||
} else {
|
||||
m->act_count -= min(m->act_count, ACT_DECLINE);
|
||||
/*
|
||||
* if the page act_count is zero, and we are low on mem -- then we deactivate
|
||||
*/
|
||||
if (!m->act_count &&
|
||||
(cnt.v_free_count+cnt.v_inactive_count < cnt.v_free_target+cnt.v_inactive_target )) {
|
||||
vm_page_deactivate(m);
|
||||
/*
|
||||
* else if on the next go-around we will deactivate the page
|
||||
* we need to place the page on the end of the queue to age
|
||||
* the other pages in memory.
|
||||
*/
|
||||
} else {
|
||||
TAILQ_REMOVE(&vm_page_queue_active, m, pageq);
|
||||
TAILQ_INSERT_TAIL(&vm_page_queue_active, m, pageq);
|
||||
TAILQ_REMOVE(&m->object->memq, m, listq);
|
||||
TAILQ_INSERT_TAIL(&m->object->memq, m, listq);
|
||||
}
|
||||
}
|
||||
m = next;
|
||||
}
|
||||
|
||||
if (pages_referenced) {
|
||||
nextscan = (pages_scanned / pages_referenced) * scantick;
|
||||
nextscan = max(nextscan, scantick);
|
||||
nextscan = min(nextscan, hz);
|
||||
} else
|
||||
nextscan = hz;
|
||||
tsleep((caddr_t) &vm_pagescanner, PVM, "scanw", nextscan);
|
||||
|
||||
goto scanloop;
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_pageout is the high level pageout daemon.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user