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/amd64 | |
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/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 353e9a3..319715d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -922,6 +922,16 @@ pmap_dispose_proc(p) #ifdef I386_CPU invltlb(); #endif + + /* + * 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); + } } /* @@ -1107,6 +1117,16 @@ pmap_dispose_thread(td) #ifdef I386_CPU invltlb(); #endif + + /* + * 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); + } } /* |