From: Jason Baron <jbaron@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: hpa@zytor.com, mathieu.desnoyers@polymtl.ca, rostedt@goodmis.org,
mingo@elte.hu, tglx@linutronix.de, andi@firstfloor.org,
roland@redhat.com, rth@redhat.com,
masami.hiramatsu.pt@hitachi.com, fweisbec@gmail.com,
avi@redhat.com, davem@davemloft.net, sam@ravnborg.org,
ddaney@caviumnetworks.com, michael@ellerman.id.au,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] jump label: introduce static_branch() interface
Date: Wed, 23 Feb 2011 10:48:29 -0500 [thread overview]
Message-ID: <20110223154829.GA2829@redhat.com> (raw)
In-Reply-To: <1298455885.2217.354.camel@twins>
On Wed, Feb 23, 2011 at 11:11:25AM +0100, Peter Zijlstra wrote:
> On Tue, 2011-02-22 at 17:28 -0500, Jason Baron wrote:
> > @@ -33,7 +28,11 @@ struct _ddebug {
> > #define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using
> > the format */
> > #define _DPRINTK_FLAGS_DEFAULT 0
> > unsigned int flags:8;
> > - char enabled;
> > +#ifdef HAVE_JUMP_LABEL
> > + struct jump_label_key enabled;
> > +#else
> > + int enabled;
> > +#endif
> > } __attribute__((aligned(8)));
> >
>
> Also, didn't you promise Mathieu a comment explaining why dynamic debug
> does funny things like this? :-) I mean we all know its because of the
> cyclic header stuff involving atomic etc.. but I'm also quite sure we'll
> all have forgotten about that in a few weeks time.
ok, how about something along these linnes:
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index 7e51b6f..5cc4771 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -1,6 +1,14 @@
#ifndef _DYNAMIC_DEBUG_H
#define _DYNAMIC_DEBUG_H
+/*
+ * When jump labels are disabled, they make use of atomic_read(). Since
+ * dynamic_debug.h gets included by kernel.h, the inclusion of jump_label.h by
+ * dynamic_debug.h and thus atomic.h (to get atomic_read()), would cause a
+ * circular dependency since atomic.h requires kernel.h. Thus, for dynamic debug
+ * we are explicitly including jump_label.h when jump labels are configured, and
+ * making use of a regular reads (non-atomic), when jump labels are disabled.
+ */
#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
#include <linux/jump_label.h>
#endif
next prev parent reply other threads:[~2011-02-23 15:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 22:28 Jason Baron
2011-02-22 23:12 ` Andi Kleen
2011-02-23 10:08 ` Peter Zijlstra
2011-02-23 10:11 ` Peter Zijlstra
2011-02-23 13:45 ` Steven Rostedt
2011-02-23 15:48 ` Jason Baron [this message]
2011-02-23 15:40 ` Steven Rostedt
2011-02-23 15:42 ` Peter Zijlstra
2011-02-23 17:12 ` David Daney
2011-03-01 15:28 ` Mathieu Desnoyers
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=20110223154829.GA2829@redhat.com \
--to=jbaron@redhat.com \
--cc=andi@firstfloor.org \
--cc=avi@redhat.com \
--cc=davem@davemloft.net \
--cc=ddaney@caviumnetworks.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=michael@ellerman.id.au \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=roland@redhat.com \
--cc=rostedt@goodmis.org \
--cc=rth@redhat.com \
--cc=sam@ravnborg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®