summaryrefslogtreecommitdiff
path: root/tools/testing/radix-tree/linux
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2016-12-15 02:08:02 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-15 03:04:09 +0300
commit847d357635ce4c63b8901ab81333586a0f115fa5 (patch)
tree512d5cb1f6aa8f44a07dbfe8e501297e5b8aebb7 /tools/testing/radix-tree/linux
parent31023cd66468359790beb046b6808fe0444672a2 (diff)
downloadlinux-847d357635ce4c63b8901ab81333586a0f115fa5.tar.xz
radix tree test suite: track preempt_count
Rather than simply NOP out preempt_enable() and preempt_disable(), keep track of preempt_count and display it regularly in case either the test suite or the code under test is forgetting to balance the enables & disables. Only found a test-case that was forgetting to re-enable preemption, but it's a possibility worth checking. Link: http://lkml.kernel.org/r/1480369871-5271-39-git-send-email-mawilcox@linuxonhyperv.com Signed-off-by: Matthew Wilcox <willy@infradead.org> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/radix-tree/linux')
-rw-r--r--tools/testing/radix-tree/linux/preempt.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/radix-tree/linux/preempt.h b/tools/testing/radix-tree/linux/preempt.h
index 6210672e3baa..65c04c226965 100644
--- a/tools/testing/radix-tree/linux/preempt.h
+++ b/tools/testing/radix-tree/linux/preempt.h
@@ -1,4 +1,4 @@
-/* */
+extern int preempt_count;
-#define preempt_disable() do { } while (0)
-#define preempt_enable() do { } while (0)
+#define preempt_disable() uatomic_inc(&preempt_count)
+#define preempt_enable() uatomic_dec(&preempt_count)