uvm_unloanpage(): fix a screwup in previous. slock must be set NULL if
it can't be acquired.
This commit is contained in:
parent
9449130074
commit
f788f8574a
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: uvm_loan.c,v 1.95 2020/02/23 15:46:43 ad Exp $ */
|
/* $NetBSD: uvm_loan.c,v 1.96 2020/02/24 21:06:11 ad Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||||
@ -32,7 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.95 2020/02/23 15:46:43 ad Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.96 2020/02/24 21:06:11 ad Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -988,6 +988,7 @@ uvm_unloanpage(struct vm_page **ploans, int npages)
|
|||||||
}
|
}
|
||||||
/* XXX Better than yielding but inadequate. */
|
/* XXX Better than yielding but inadequate. */
|
||||||
kpause("livelock", false, 1, &pg->interlock);
|
kpause("livelock", false, 1, &pg->interlock);
|
||||||
|
slock = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1015,9 +1016,11 @@ uvm_unloanpage(struct vm_page **ploans, int npages)
|
|||||||
KASSERT((pg->flags & PG_BUSY) == 0);
|
KASSERT((pg->flags & PG_BUSY) == 0);
|
||||||
uvm_pagefree(pg);
|
uvm_pagefree(pg);
|
||||||
}
|
}
|
||||||
|
if (slock != NULL) {
|
||||||
rw_exit(slock);
|
rw_exit(slock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* uvm_unloan: kill loans on pages or anons.
|
* uvm_unloan: kill loans on pages or anons.
|
||||||
|
Loading…
Reference in New Issue
Block a user