summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2002-02-28 07:41:12 +0000
committersilby <silby@FreeBSD.org>2002-02-28 07:41:12 +0000
commitc58cf9d7420e8194c0229a010158c567c248c5e3 (patch)
treea17b1d6c23b9b38018a2dba789f268fc22b5190f /sys/sparc64
parent8d0940232389d8d7989cf4b464257ecb60976975 (diff)
downloadFreeBSD-src-c58cf9d7420e8194c0229a010158c567c248c5e3.zip
FreeBSD-src-c58cf9d7420e8194c0229a010158c567c248c5e3.tar.gz
Fix a minor swap leak.
Previously, the UPAGES/KSTACK area of processes/threads would leak memory at the time that a previously swapped process was terminated. Lukcily, the leak was only 12K/proc, so it was unlikely to be a major problem unless you had an undersized swap partition. Submitted by: dillon Reviewed by: silby MFC after: 1 week
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/pmap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 4836d78..e92402d 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -853,6 +853,16 @@ pmap_dispose_proc(struct proc *p)
vm_page_free(m);
}
pmap_qremove(up, UAREA_PAGES);
+
+ /*
+ * If the process got swapped out some of its UPAGES might have gotten
+ * swapped. Just get rid of the object to clean up the swap use
+ * proactively. NOTE! might block waiting for paging I/O to complete.
+ */
+ if (upobj->type == OBJT_SWAP) {
+ p->p_upages_obj = NULL;
+ vm_object_deallocate(upobj);
+ }
}
/*
@@ -995,6 +1005,16 @@ pmap_dispose_thread(struct thread *td)
vm_page_free(m);
}
pmap_qremove(ks, KSTACK_PAGES);
+
+ /*
+ * If the thread got swapped out some of its KSTACK might have gotten
+ * swapped. Just get rid of the object to clean up the swap use
+ * proactively. NOTE! might block waiting for paging I/O to complete.
+ */
+ if (ksobj->type == OBJT_SWAP) {
+ td->td_kstack_obj = NULL;
+ vm_object_deallocate(ksobj);
+ }
}
/*
OpenPOWER on IntegriCloud