Date: Sun, 29 May 2022 11:16:09 -0700 From: Mark Millard <marklmi@yahoo.com> To: Pete Wright <pete@nomadlogic.org> Cc: freebsd-current <freebsd-current@freebsd.org> Subject: Re: Chasing OOM Issues - good sysctl metrics to use? Message-ID: <CE2AA4C9-293A-4C87-A619-DABAC1141494@yahoo.com> In-Reply-To: <b6017cc8-3734-da81-8c73-5715f2e3ff94@nomadlogic.org> References: <8C14A90D-3429-437C-A815-E811B7BFBF05.ref@yahoo.com> <8C14A90D-3429-437C-A815-E811B7BFBF05@yahoo.com> <b6017cc8-3734-da81-8c73-5715f2e3ff94@nomadlogic.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-May-29, at 10:07, Pete Wright <pete@nomadlogic.org> wrote: > On 5/14/22 01:09, Mark Millard wrote: >>=20 >> One of the points is to see if I get any evidence of >> vm.swap_enabled=3D0 with vm.swap_idle_enabled=3D0 ending up >> contributing to any problems in my normal usage. So far: no. >> vm.pageout_oom_seq=3D120 is in use for this, my normal >> context since sometime in 2018. >=20 > So to revive an old thread here. >=20 > it looks like setting these two sysctl knobs have helped the = situation: > vm.swap_enabled=3D0 > vm.swap_idle_enabled=3D0 >=20 > i've gone 7 days without any OOM events under normal work usage (as = opposed to about 4days previously). FYI, the combination: vm.pageout_oom_seq=3D120 # in /boot/loader.conf vm.swap_enabled=3D0 # in /etc/sysctl.conf vm.swap_idle_enabled=3D0 # in /etc/sysctl.conf still has not caused me any additional problems and helps avoid loss of access by avoiding the relevant interaction-processes from having their kernel stacks swapped out. (Not that the effect of vm.swap_enabled=3D0 is limited to interaction-processes.) So, the combination is now part of the configuration of each FreeBSD that I use. > this includes the following patch to vm_pageout.c that tijl@ shared = with us: >=20 > diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c > index 36d5f327580..df827af3075 100644 > --- a/sys/vm/vm_pageout.c > +++ b/sys/vm/vm_pageout.c > @@ -1069,7 +1069,7 @@ vm_pageout_laundry_worker(void *arg) > nclean =3D vmd->vmd_free_count + > vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt; > ndirty =3D vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt; > - if (target =3D=3D 0 && ndirty * isqrt(howmany(nfreed + = 1, > + if (target =3D=3D 0 && ndirty * isqrt(howmany(nfreed, > vmd->vmd_free_target - vmd->vmd_free_min)) >=3D = nclean) { > target =3D vmd->vmd_background_launder_target; > } FYI: I restored the original code after doing the testing for tijl@ . > I have adjusted my behavior a little bit as well, since i do quite a = bit of work in the AWS console in firefox I've been better at closing = out all of those tabs when i'm not using them (their console is a = serious memory hog). i've also started using an official chrome binary = inside an ubuntu jail which is where i run slack and discord, that seems = to behave better as well in terms of memory utilization. >=20 > i am going to revert the vm_pageout.c patch today when i do my weekly = rebuild of world to see how things go, maybe that'll give determine if = its really the sysctl's helping or not. =3D=3D=3D Mark Millard marklmi at yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CE2AA4C9-293A-4C87-A619-DABAC1141494>