Re: git: 4a864f624a70 - main - vm_pageout: Print a more accurate message to the console before an OOM kill

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 15 Jan 2022 05:38:56 UTC
Thanks. This will allow me to remove part of my personal additions
in this area --and my having to explain the misnomer when trying
to help someone analyze why they end up with OOM activity so they
can figure out what to do about it.

There seem to be two separate sources of VM_OOM_SWAPZ. Showing
my personal additions for them (just making them explicit in the
sequence of messages generated):

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 01cf9233329f..280621ca51be 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2091,6 +2091,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk)
                                    0, 1))
                                        printf("swap blk zone exhausted, "
                                            "increase kern.maxswzone\n");
+                               printf("swp_pager_meta_build: swap blk uma zone exhausted\n");
                                vm_pageout_oom(VM_OOM_SWAPZ);
                                pause("swzonxb", 10);
                        } else
@@ -2121,6 +2122,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk)
                                    0, 1))
                                        printf("swap pctrie zone exhausted, "
                                            "increase kern.maxswzone\n");
+                               printf("swp_pager_meta_build: swap pctrie uma zone exhausted\n");
                                vm_pageout_oom(VM_OOM_SWAPZ);
                                pause("swzonxp", 10);
                        } else

Care to comment on the distinctions and why there are two
contexts classified as "out of swap space"? Would either
one show the swap space as (nearly?) all used in, say, top?
Or might one of them still end up looking like a misnomer
from just a top (or whatever) display?

===
Mark Millard
marklmi at yahoo.com