All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: akpm@linux-foundation.org, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com, josh@joshtriplett.org,
	dvhltc@us.ibm.com, niv@us.ibm.com, tglx@linutronix.de,
	peterz@infradead.org, rostedt@goodmis.org,
	Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
	eric.dumazet@gmail.com, adobriyan@gmail.com,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH] rcu head debug consider on stack fixup
Date: Mon, 29 Mar 2010 11:14:13 -0400	[thread overview]
Message-ID: <20100329151413.GA26979@Krystal> (raw)
In-Reply-To: <20100329143702.845838001@efficios.com>

Complain if activation receives a non-initialized object on the stack.

[This patch applies after "tree/tiny rcu: Add debug RCU head objects (v5)"]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: David S. Miller <davem@davemloft.net>
CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
CC: akpm@linux-foundation.org
CC: mingo@elte.hu
CC: laijs@cn.fujitsu.com
CC: dipankar@in.ibm.com
CC: josh@joshtriplett.org
CC: dvhltc@us.ibm.com
CC: niv@us.ibm.com
CC: tglx@linutronix.de
CC: peterz@infradead.org
CC: rostedt@goodmis.org
CC: Valdis.Kletnieks@vt.edu
CC: dhowells@redhat.com
CC: eric.dumazet@gmail.com
CC: Alexey Dobriyan <adobriyan@gmail.com>
---
 kernel/rcupdate.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: linux.trees.git/kernel/rcupdate.c
===================================================================
--- linux.trees.git.orig/kernel/rcupdate.c	2010-03-29 11:05:35.000000000 -0400
+++ linux.trees.git/kernel/rcupdate.c	2010-03-29 11:06:23.000000000 -0400
@@ -179,8 +179,12 @@ static int rcuhead_fixup_activate(void *
 		 * This is not really a fixup. We just make sure that it is
 		 * tracked in the object tracker.
 		 */
-		debug_object_init(head, &rcuhead_debug_descr);
-		debug_object_activate(head, &rcuhead_debug_descr);
+		if (!object_is_on_stack(head)) {
+			debug_object_init(head, &rcuhead_debug_descr);
+			debug_object_activate(head, &rcuhead_debug_descr);
+			return 0;
+		}
+		WARN_ON_ONCE(1);
 		return 0;
 
 	case ODEBUG_STATE_ACTIVE:
-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

      reply	other threads:[~2010-03-29 15:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 14:34 [patch 0/5] RCU head debug (v5) Mathieu Desnoyers
2010-03-29 14:34 ` [patch 1/5] Debugobjects transition check Mathieu Desnoyers
2010-03-30 16:21   ` Thomas Gleixner
2010-03-31 13:31     ` Mathieu Desnoyers
2010-03-31 13:51       ` Thomas Gleixner
2010-03-31 14:27         ` Mathieu Desnoyers
2010-04-06  8:15           ` Thomas Gleixner
2010-04-06 12:53             ` [patch 1/5] Debugobjects transition check (updated changelog) Mathieu Desnoyers
2010-04-15 18:32               ` Thomas Gleixner
2010-04-15 18:37                 ` Paul E. McKenney
2010-03-29 14:34 ` [patch 2/5] rcu head introduce rcu head init on stack Mathieu Desnoyers
2010-03-29 14:34 ` [patch 3/5] remove all rcu head initializations, except on_stack initializations Mathieu Desnoyers
2010-03-29 14:34 ` [patch 4/5] rcu head remove init Mathieu Desnoyers
2010-03-29 14:34 ` [patch 5/5] tree/tiny rcu: Add debug RCU head objects (v5) Mathieu Desnoyers
2010-03-29 15:14   ` Mathieu Desnoyers [this message]

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=20100329151413.GA26979@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhltc@us.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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.