Date: Tue, 21 Nov 2017 22:06:49 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r326078 - user/jeff/numa/sys/vm Message-ID: <201711212206.vALM6nLD003484@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Tue Nov 21 22:06:49 2017 New Revision: 326078 URL: https://svnweb.freebsd.org/changeset/base/326078 Log: Fix for r325754 Limit UMA reclaim calls to once per-second. Modified: user/jeff/numa/sys/vm/uma_core.c Modified: user/jeff/numa/sys/vm/uma_core.c ============================================================================== --- user/jeff/numa/sys/vm/uma_core.c Tue Nov 21 21:18:04 2017 (r326077) +++ user/jeff/numa/sys/vm/uma_core.c Tue Nov 21 22:06:49 2017 (r326078) @@ -3306,16 +3306,19 @@ void uma_reclaim_worker(void *arg __unused) { - sx_xlock(&uma_drain_lock); for (;;) { - sx_sleep(uma_reclaim, &uma_drain_lock, PVM, "umarcl", 0); - if (uma_reclaim_needed) { - sx_xunlock(&uma_drain_lock); - EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); - sx_xlock(&uma_drain_lock); - uma_reclaim_locked(true); - atomic_set_int(&uma_reclaim_needed, 0); - } + sx_xlock(&uma_drain_lock); + while (uma_reclaim_needed == 0) + sx_sleep(uma_reclaim, &uma_drain_lock, PVM, "umarcl", + hz); + sx_xunlock(&uma_drain_lock); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); + sx_xlock(&uma_drain_lock); + uma_reclaim_locked(true); + atomic_set_int(&uma_reclaim_needed, 0); + sx_xunlock(&uma_drain_lock); + /* Don't fire more than once per-second. */ + pause("umarclslp", hz); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711212206.vALM6nLD003484>