linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -rt] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals
@ 2015-01-28 19:08 Xander Huff
  2015-01-28 21:06 ` Xander Huff
  0 siblings, 1 reply; 3+ messages in thread
From: Xander Huff @ 2015-01-28 19:08 UTC (permalink / raw)
  To: mingo, peterz, rostedt
  Cc: linux-rt-users, josh.cartwright, gratian.crisan, linux-kernel,
	jaeden.amero, ben.shelton, brad.mouring, rich.tollerton,
	Xander Huff

From: Josh Cartwright <josh.cartwright@ni.com>

"lockdep: Selftest: Only do hardirq context test for raw spinlock"
disabled the execution of certain tests with PREEMPT_RT_FULL, but did
not prevent the tests from still being defined.  This leads to warnings
like:

  ./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_12' defined but not used [-Wunused-function]
  ./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_21' defined but not used [-Wunused-function]
  ./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_12' defined but not used [-Wunused-function]
  ./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_21' defined but not used [-Wunused-function]
  ./linux/lib/locking-selftest.c:580:1: warning: 'irqsafe1_soft_spin_12' defined but not used [-Wunused-function]
  ...

Fixed by wrapping the test definitions in #ifndef CONFIG_PREEMPT_RT_FULL
conditionals.

Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
Signed-off-by: Xander Huff <xander.huff@ni.com>
Acked-by: Gratian Crisan <gratian.crisan@ni.com>
---
 lib/locking-selftest.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index 507a22f..51e558f 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -570,6 +570,8 @@ GENERATE_TESTCASE(init_held_rsem)
 #include "locking-selftest-spin-hardirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_spin)
 
+#ifndef CONFIG_PREEMPT_RT_FULL
+
 #include "locking-selftest-rlock-hardirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock)
 
@@ -585,9 +587,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock)
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock)
 
+#endif
+
 #undef E1
 #undef E2
 
+#ifndef CONFIG_PREEMPT_RT_FULL
 /*
  * Enabling hardirqs with a softirq-safe lock held:
  */
@@ -620,6 +625,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock)
 #undef E1
 #undef E2
 
+#endif
+
 /*
  * Enabling irqs with an irq-safe lock held:
  */
@@ -643,6 +650,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock)
 #include "locking-selftest-spin-hardirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_spin)
 
+#ifndef CONFIG_PREEMPT_RT_FULL
+
 #include "locking-selftest-rlock-hardirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock)
 
@@ -658,6 +667,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock)
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock)
 
+#endif
+
 #undef E1
 #undef E2
 
@@ -689,6 +700,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock)
 #include "locking-selftest-spin-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_spin)
 
+#ifndef CONFIG_PREEMPT_RT_FULL
+
 #include "locking-selftest-rlock-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock)
 
@@ -704,6 +717,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock)
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
 
+#endif
+
 #undef E1
 #undef E2
 #undef E3
@@ -737,6 +752,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
 #include "locking-selftest-spin-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_spin)
 
+#ifndef CONFIG_PREEMPT_RT_FULL
+
 #include "locking-selftest-rlock-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock)
 
@@ -752,10 +769,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock)
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock)
 
+#endif
+
 #undef E1
 #undef E2
 #undef E3
 
+#ifndef CONFIG_PREEMPT_RT_FULL
+
 /*
  * read-lock / write-lock irq inversion.
  *
@@ -818,6 +839,10 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_wlock)
 #undef E2
 #undef E3
 
+#endif
+
+#ifndef CONFIG_PREEMPT_RT_FULL
+
 /*
  * read-lock / write-lock recursion that is actually safe.
  */
@@ -856,6 +881,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft)
 #undef E2
 #undef E3
 
+#endif
+
 /*
  * read-lock / write-lock recursion that is unsafe.
  */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -rt] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals
  2015-01-28 19:08 [PATCH -rt] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals Xander Huff
@ 2015-01-28 21:06 ` Xander Huff
  2015-02-26 14:14   ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Xander Huff @ 2015-01-28 21:06 UTC (permalink / raw)
  To: mingo, peterz, rostedt
  Cc: linux-rt-users, josh.cartwright, gratian.crisan, linux-kernel,
	jaeden.amero, ben.shelton, brad.mouring, rich.tollerton

On 1/28/2015 1:08 PM, Xander Huff wrote:
> From: Josh Cartwright <josh.cartwright@ni.com>
>
> "lockdep: Selftest: Only do hardirq context test for raw spinlock"
> disabled the execution of certain tests with PREEMPT_RT_FULL, but did
> not prevent the tests from still being defined.  This leads to warnings
> like:
>
>    ./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_12' defined but not used [-Wunused-function]
>    ./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_21' defined but not used [-Wunused-function]
>    ./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_12' defined but not used [-Wunused-function]
>    ./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_21' defined but not used [-Wunused-function]
>    ./linux/lib/locking-selftest.c:580:1: warning: 'irqsafe1_soft_spin_12' defined but not used [-Wunused-function]
>    ...
>
> Fixed by wrapping the test definitions in #ifndef CONFIG_PREEMPT_RT_FULL
> conditionals.
>
> Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
> Signed-off-by: Xander Huff <xander.huff@ni.com>
> Acked-by: Gratian Crisan <gratian.crisan@ni.com>

FYI: To be clearer, this should apply to all stable RT releases 3.4 and later.

-- 
Xander Huff
Staff Software Engineer
National Instruments

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -rt] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals
  2015-01-28 21:06 ` Xander Huff
@ 2015-02-26 14:14   ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-02-26 14:14 UTC (permalink / raw)
  To: Xander Huff
  Cc: mingo, peterz, rostedt, linux-rt-users, josh.cartwright,
	gratian.crisan, linux-kernel, jaeden.amero, ben.shelton,
	brad.mouring, rich.tollerton

* Xander Huff | 2015-01-28 15:06:59 [-0600]:

>>Fixed by wrapping the test definitions in #ifndef CONFIG_PREEMPT_RT_FULL
>>conditionals.
>>
>FYI: To be clearer, this should apply to all stable RT releases 3.4 and later.

Applied

Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-26 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-28 19:08 [PATCH -rt] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals Xander Huff
2015-01-28 21:06 ` Xander Huff
2015-02-26 14:14   ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).