mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
LinuxKPI: allocate current before taking shrinkers lock
This fixes following warnings when shrinkers are invoked first time: uma_zalloc_debug: zone "lkpicurr" with the following non-sleepable locks held: exclusive sleep mutex lkpi-shrinker (lkpi-shrinker) uma_zalloc_debug: zone "lkpimm" with the following non-sleepable locks held: exclusive sleep mutex lkpi-shrinker (lkpi-shrinker) Reviewed by: hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32066
This commit is contained in:
parent
b58c916f11
commit
2fe9ea5d3a
1 changed files with 2 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
|
|||
#include <sys/eventhandler.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#include <linux/compat.h>
|
||||
#include <linux/shrinker.h>
|
||||
|
||||
TAILQ_HEAD(, shrinker) lkpi_shrinkers = TAILQ_HEAD_INITIALIZER(lkpi_shrinkers);
|
||||
|
|
@ -93,6 +94,7 @@ linuxkpi_vm_lowmem(void *arg __unused)
|
|||
{
|
||||
struct shrinker *s;
|
||||
|
||||
linux_set_current(curthread);
|
||||
mtx_lock(&mtx_shrinker);
|
||||
TAILQ_FOREACH(s, &lkpi_shrinkers, next) {
|
||||
shrinker_shrink(s);
|
||||
|
|
|
|||
Loading…
Reference in a new issue