diff options
author | silby <silby@FreeBSD.org> | 2002-02-28 07:41:12 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2002-02-28 07:41:12 +0000 |
commit | c58cf9d7420e8194c0229a010158c567c248c5e3 (patch) | |
tree | a17b1d6c23b9b38018a2dba789f268fc22b5190f /sys/alpha | |
parent | 8d0940232389d8d7989cf4b464257ecb60976975 (diff) | |
download | FreeBSD-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/alpha')
-rw-r--r-- | sys/alpha/alpha/pmap.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 1bee3dd..374adc1 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -990,6 +990,16 @@ pmap_dispose_proc(p) vm_page_unwire(m, 0); vm_page_free(m); } + + /* + * 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); + } } /* @@ -1153,6 +1163,16 @@ pmap_dispose_thread(td) vm_page_unwire(m, 0); vm_page_free(m); } + + /* + * 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); + } } /* |