Lines 1829-1834
vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage,
Link Here
|
1829 |
* start OOM. Initiate the selection and signaling of the |
1829 |
* start OOM. Initiate the selection and signaling of the |
1830 |
* victim. |
1830 |
* victim. |
1831 |
*/ |
1831 |
*/ |
|
|
1832 |
printf("vm_pageout_mightbe_oom: kill context: v_free_count: %u, v_inactive_count: %u\n", |
1833 |
vmd->vmd_free_count, vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt); |
1832 |
vm_pageout_oom(VM_OOM_MEM); |
1834 |
vm_pageout_oom(VM_OOM_MEM); |
1833 |
|
1835 |
|
1834 |
/* |
1836 |
/* |
Lines 2021-2030
vm_pageout_oom(int shortage)
Link Here
|
2021 |
} |
2023 |
} |
2022 |
sx_sunlock(&allproc_lock); |
2024 |
sx_sunlock(&allproc_lock); |
2023 |
if (bigproc != NULL) { |
2025 |
if (bigproc != NULL) { |
|
|
2026 |
char *reason_text; |
2027 |
switch (shortage) { |
2028 |
case VM_OOM_MEM_PF: |
2029 |
reason_text= "fault's page allocation failed"; |
2030 |
break; |
2031 |
case VM_OOM_MEM: |
2032 |
reason_text= "free RAM stayed below threshold"; |
2033 |
break; |
2034 |
case VM_OOM_SWAPZ: |
2035 |
reason_text= "swblk or swpctrie zone exhausted"; |
2036 |
break; |
2037 |
default: |
2038 |
reason_text= "Unknown Reason"; |
2039 |
} |
2024 |
if (vm_panic_on_oom != 0 && --vm_panic_on_oom == 0) |
2040 |
if (vm_panic_on_oom != 0 && --vm_panic_on_oom == 0) |
2025 |
panic("out of swap space"); |
2041 |
panic("%s",reason_text); |
2026 |
PROC_LOCK(bigproc); |
2042 |
PROC_LOCK(bigproc); |
2027 |
killproc(bigproc, "out of swap space"); |
2043 |
killproc(bigproc, reason_text); |
2028 |
sched_nice(bigproc, PRIO_MIN); |
2044 |
sched_nice(bigproc, PRIO_MIN); |
2029 |
_PRELE(bigproc); |
2045 |
_PRELE(bigproc); |
2030 |
PROC_UNLOCK(bigproc); |
2046 |
PROC_UNLOCK(bigproc); |