]> git.ipfire.org Git - thirdparty/linux.git/commit - mm/slub.c
mm: slub: test: Use the kunit_get_current_test() function
authorDavid Gow <davidgow@google.com>
Fri, 25 Nov 2022 08:43:06 +0000 (16:43 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 12 Dec 2022 21:13:47 +0000 (14:13 -0700)
commit909c6475d568826be377893cf5abb7cde5877230
tree31df9e91758274a18a70b5ecff90a4e511f1863c
parent91e93592219f74c4d5cd4f27006d726ac86ae15d
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>
lib/slub_kunit.c
mm/slub.c