[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1334647419-10337-1-git-send-email-yong.zhang0@gmail.com>
Date: Tue, 17 Apr 2012 15:23:39 +0800
From: Yong Zhang <yong.zhang0@...il.com>
To: linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de, Yong Zhang <yong.zhang@...driver.com>
Subject: [PATCH 3/3 -rt] lockdep: selftest: save/restore migrate_disable count
From: Yong Zhang <yong.zhang@...driver.com>
->migrate_disable_atomic will corrupt when doing some
case, such as double lock...
->migrate_disable will not be affected for now since
we have preempt disabled when doing seft test.
Just record it also for safe.
Signed-off-by: Yong Zhang <yong.zhang0@...il.com>
---
Found it when enable CONFIG_SCHED_DEBUG.
lib/locking-selftest.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index 23b8564..a9cb9e4 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -939,6 +939,12 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
{
unsigned long saved_preempt_count = preempt_count();
int expected_failure = 0;
+#ifdef CONFIG_PREEMPT_RT_FULL
+ int saved_migrate_disable = current->migrate_disable;
+# ifdef CONFIG_SCHED_DEBUG
+ int saved_migrate_disable_atomic = current->migrate_disable_atomic;
+# endif
+#endif
WARN_ON(irqs_disabled());
@@ -980,6 +986,13 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
* count, so restore it:
*/
preempt_count() = saved_preempt_count;
+#ifdef CONFIG_PREEMPT_RT_FULL
+ current->migrate_disable = saved_migrate_disable;
+# ifdef CONFIG_SCHED_DEBUG
+ current->migrate_disable_atomic = saved_migrate_disable_atomic;
+# endif
+#endif
+
#ifdef CONFIG_TRACE_IRQFLAGS
if (softirq_count())
current->softirqs_enabled = 0;
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists