All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-rt-users@vger.kernel.org
Subject: [PATCH][DEBUG_PI_LIST]: Set plist.lock to NULL on PREEMPT_RT
Date: Mon, 22 Oct 2007 14:43:02 -0200	[thread overview]
Message-ID: <20071022164302.GB15773@ghostprotocols.net> (raw)

On RT struct plist_head->lock is a raw_spinlock_t, but struct futex_hash_bucket->lock,
that is set to plist_head->lock is a spinlock, which becomes a mutex on RT.
Later in plist_check_head spin_is_locked can't figure out what is the right type,
triggering a WARN_ON_SMP. As we were already special casing PREEMPT_RT on
plist_check_head..

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff -uNrp linux-2.6.23-rt1.orig/kernel/futex.c linux-2.6.23-rt1/kernel/futex.c
--- linux-2.6.23-rt1.orig/kernel/futex.c	2007-10-22 12:28:11.000000000 -0200
+++ linux-2.6.23-rt1/kernel/futex.c	2007-10-22 12:27:07.000000000 -0200
@@ -947,9 +947,13 @@ static int futex_requeue(u32 __user *uad
 				plist_del(&this->list, &hb1->chain);
 				plist_add(&this->list, &hb2->chain);
 				this->lock_ptr = &hb2->lock;
-#if defined(CONFIG_DEBUG_PI_LIST) && !defined(CONFIG_PREEMPT_RT)
+#ifdef CONFIG_DEBUG_PI_LIST
+#ifdef CONFIG_PREEMPT_RT
+				this->list.plist.lock = NULL;
+#else
 				this->list.plist.lock = &hb2->lock;
 #endif
+#endif
 			}
 			this->key = key2;
 			get_futex_key_refs(&key2);
@@ -1008,9 +1012,13 @@ static inline void __queue_me(struct fut
 	prio = min(current->normal_prio, MAX_RT_PRIO);
 
 	plist_node_init(&q->list, prio);
-#if defined(CONFIG_DEBUG_PI_LIST) && !defined(CONFIG_PREEMPT_RT)
+#ifdef CONFIG_DEBUG_PI_LIST
+#ifdef CONFIG_PREEMPT_RT
+	q->list.plist.lock = NULL;
+#else
 	q->list.plist.lock = &hb->lock;
 #endif
+#endif
 	plist_add(&q->list, &hb->chain);
 	q->task = current;
 	spin_unlock(&hb->lock);

                 reply	other threads:[~2007-10-22 16:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071022164302.GB15773@ghostprotocols.net \
    --to=acme@ghostprotocols.net \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.