diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-12-19 12:07:55 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-12-19 12:07:55 +0000 |
| commit | ed314ebd4ef538a14a8987dc94bcd4ceab090d79 (patch) | |
| tree | f46ecce10cf3e20a845ba5edf5e9e3002b3564d0 /sys/external/bsd/common/linux | |
| parent | 3a9e48730c2a1846dfd4f94e584c7d17aabb2d22 (diff) | |
linux: Use kmem directly for Linux kmalloc.
Take advantage of this to do LOCKDEBUG_MEM_CHECK at the point of
kfree_rcu rather than in the RCU GC thread.
Diffstat (limited to 'sys/external/bsd/common/linux')
| -rw-r--r-- | sys/external/bsd/common/linux/linux_rcu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/external/bsd/common/linux/linux_rcu.c b/sys/external/bsd/common/linux/linux_rcu.c index abfc834aa3a..930ac5c1a71 100644 --- a/sys/external/bsd/common/linux/linux_rcu.c +++ b/sys/external/bsd/common/linux/linux_rcu.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_rcu.c,v 1.4 2021/12/19 11:49:11 riastradh Exp $ */ +/* $NetBSD: linux_rcu.c,v 1.5 2021/12/19 12:07:55 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,13 +30,15 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.4 2021/12/19 11:49:11 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.5 2021/12/19 12:07:55 riastradh Exp $"); #include <sys/param.h> #include <sys/types.h> + #include <sys/condvar.h> #include <sys/cpu.h> #include <sys/kthread.h> +#include <sys/lockdebug.h> #include <sys/mutex.h> #include <sys/sdt.h> #include <sys/xcall.h> @@ -191,6 +193,8 @@ void _kfree_rcu(struct rcu_head *head, void *obj) { + LOCKDEBUG_MEM_CHECK(obj, ((struct linux_malloc *)obj - 1)->lm_size); + head->rcuh_u.obj = obj; mutex_enter(&gc.lock); |
