summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2018-03-31 13:19:27 +0000
committerkib <kib@FreeBSD.org>2018-03-31 13:19:27 +0000
commit67843375d3eb84dcb779a957ef89bed98a45a823 (patch)
tree2b299cfceadb55e4d8c20f2b454129d650ef813c /sys/kern
parentfb0ce9d090d1cf885e1a67034e3e3facf3fa18da (diff)
downloadFreeBSD-src-67843375d3eb84dcb779a957ef89bed98a45a823.zip
FreeBSD-src-67843375d3eb84dcb779a957ef89bed98a45a823.tar.gz
MFC r331490:
Account the size of the vslock-ed memory by the thread.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_fork.c1
-rw-r--r--sys/kern/kern_kthread.c1
-rw-r--r--sys/kern/kern_thr.c1
-rw-r--r--sys/kern/subr_trap.c2
4 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 5108c3d..301dbfb 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -483,6 +483,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
bzero(&td2->td_startzero,
__rangeof(struct thread, td_startzero, td_endzero));
td2->td_sleeptimo = 0;
+ td2->td_vslock_sz = 0;
bzero(&td2->td_si, sizeof(td2->td_si));
bcopy(&td->td_startcopy, &td2->td_startcopy,
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
index f5c62cc..138cbd4 100644
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -274,6 +274,7 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p,
bzero(&newtd->td_startzero,
__rangeof(struct thread, td_startzero, td_endzero));
newtd->td_sleeptimo = 0;
+ newtd->td_vslock_sz = 0;
bzero(&newtd->td_si, sizeof(newtd->td_si));
bcopy(&oldtd->td_startcopy, &newtd->td_startcopy,
__rangeof(struct thread, td_startcopy, td_endcopy));
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index e434487..1553464 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -233,6 +233,7 @@ thread_create(struct thread *td, struct rtprio *rtp,
bzero(&newtd->td_startzero,
__rangeof(struct thread, td_startzero, td_endzero));
newtd->td_sleeptimo = 0;
+ newtd->td_vslock_sz = 0;
bzero(&newtd->td_si, sizeof(newtd->td_si));
bcopy(&td->td_startcopy, &newtd->td_startcopy,
__rangeof(struct thread, td_startcopy, td_endcopy));
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 1c9db43..a5e260f 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -176,6 +176,8 @@ userret(struct thread *td, struct trapframe *frame)
("userret: Returning with stop signals deferred"));
KASSERT(td->td_su == NULL,
("userret: Returning with SU cleanup request not handled"));
+ KASSERT(td->td_vslock_sz == 0,
+ ("userret: Returning with vslock-wired space"));
#ifdef VIMAGE
/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
VNET_ASSERT(curvnet == NULL,
OpenPOWER on IntegriCloud