Date: Sat, 4 Mar 2017 12:05:46 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314663 - stable/11/sys/vm Message-ID: <201703041205.v24C5kGa047719@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Mar 4 12:05:46 2017 New Revision: 314663 URL: https://svnweb.freebsd.org/changeset/base/314663 Log: MFC r314272: call vm_lowmem hook in uma_reclaim_worker Modified: stable/11/sys/vm/uma_core.c stable/11/sys/vm/vm_kern.c stable/11/sys/vm/vm_pageout.c stable/11/sys/vm/vm_pageout.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/uma_core.c Sat Mar 4 12:05:46 2017 (r314663) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bitset.h> +#include <sys/eventhandler.h> #include <sys/kernel.h> #include <sys/types.h> #include <sys/queue.h> @@ -3199,6 +3200,9 @@ uma_reclaim_worker(void *arg __unused) "umarcl", 0); if (uma_reclaim_needed) { uma_reclaim_needed = 0; + sx_xunlock(&uma_drain_lock); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); + sx_xlock(&uma_drain_lock); uma_reclaim_locked(true); } } Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/vm_kern.c Sat Mar 4 12:05:46 2017 (r314663) @@ -549,11 +549,13 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &i, 0, req); if (error) return (error); - if (i) - EVENTHANDLER_INVOKE(vm_lowmem, 0); + if ((i & ~(VM_LOW_KMEM | VM_LOW_PAGES)) != 0) + return (EINVAL); + if (i != 0) + EVENTHANDLER_INVOKE(vm_lowmem, i); return (0); } SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_RW, 0, 0, - debug_vm_lowmem, "I", "set to trigger vm_lowmem event"); + debug_vm_lowmem, "I", "set to trigger vm_lowmem event with given flags"); #endif Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/vm_pageout.c Sat Mar 4 12:05:46 2017 (r314663) @@ -871,7 +871,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * Decrease registered cache sizes. */ SDT_PROBE0(vm, , , vm__lowmem_scan); - EVENTHANDLER_INVOKE(vm_lowmem, 0); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_PAGES); /* * We do this explicitly after the caches have been * drained above. Modified: stable/11/sys/vm/vm_pageout.h ============================================================================== --- stable/11/sys/vm/vm_pageout.h Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/vm_pageout.h Sat Mar 4 12:05:46 2017 (r314663) @@ -87,6 +87,12 @@ extern bool vm_pages_needed; #define VM_OOM_SWAPZ 2 /* + * vm_lowmem flags. + */ +#define VM_LOW_KMEM 0x01 +#define VM_LOW_PAGES 0x02 + +/* * Exported routines. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703041205.v24C5kGa047719>