diff options
author | David Gow <davidgow@google.com> | 2022-11-25 09:43:06 +0100 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2022-12-12 22:13:47 +0100 |
commit | 909c6475d568826be377893cf5abb7cde5877230 (patch) | |
tree | 31df9e91758274a18a70b5ecff90a4e511f1863c /lib/slub_kunit.c | |
parent | kunit: Use the static key when retrieving the current test (diff) | |
download | linux-909c6475d568826be377893cf5abb7cde5877230.tar.xz linux-909c6475d568826be377893cf5abb7cde5877230.zip |
mm: slub: test: Use the kunit_get_current_test() function
Use the newly-added function kunit_get_current_test() instead of
accessing current->kunit_test directly. This function uses a static key
to return more quickly when KUnit is enabled, but no tests are actively
running. There should therefore be a negligible performance impact to
enabling the slub KUnit tests.
Other than the performance improvement, this should be a no-op.
Cc: Oliver Glitta <glittao@gmail.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Gow <davidgow@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/slub_kunit.c')
-rw-r--r-- | lib/slub_kunit.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/slub_kunit.c b/lib/slub_kunit.c index 7a0564d7cb7a..8fd19c8301ad 100644 --- a/lib/slub_kunit.c +++ b/lib/slub_kunit.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <kunit/test.h> +#include <kunit/test-bug.h> #include <linux/mm.h> #include <linux/slab.h> #include <linux/module.h> |