Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2021 20:27:34 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2fe9ea5d3ad6 - main - LinuxKPI: allocate current before taking shrinkers lock
Message-ID:  <202109292027.18TKRYat038549@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=2fe9ea5d3ad69d880138d98b2ae8d2c4309eeafa

commit 2fe9ea5d3ad69d880138d98b2ae8d2c4309eeafa
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2021-09-29 20:12:58 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2021-09-29 20:12:58 +0000

    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
---
 sys/compat/linuxkpi/common/src/linux_shrinker.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c
index 0423f4e05804..b66316c22013 100644
--- a/sys/compat/linuxkpi/common/src/linux_shrinker.c
+++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109292027.18TKRYat038549>