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
This commit is contained in:
parent
25416dcedf
commit
f4e18c9afd
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user