From: Frederic Weisbecker <fweisbec@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Liu Chuansheng <chuansheng.liu@intel.com>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 2/3] core: Convert printk_once to use DO_ONCE
Date: Tue, 15 Oct 2013 23:12:52 +0200 [thread overview]
Message-ID: <20131015211251.GE3269@localhost.localdomain> (raw)
In-Reply-To: <1381870805.22110.37.camel@joe-AO722>
On Tue, Oct 15, 2013 at 02:00:05PM -0700, Joe Perches wrote:
> On Tue, 2013-10-15 at 22:50 +0200, Frederic Weisbecker wrote:
> []
> > diff --git a/include/linux/printk.h b/include/linux/printk.h
> []
> > @@ -252,14 +253,7 @@ extern asmlinkage void dump_stack(void) __cold;
> >
> > #ifdef CONFIG_PRINTK
> > #define printk_once(fmt, ...) \
> > -({ \
> > - static bool __print_once; \
> > - \
> > - if (!__print_once) { \
> > - __print_once = true; \
> > - printk(fmt, ##__VA_ARGS__); \
> > - } \
> > -})
> > + DO_ONCE(printk(fmt, ##__VA_ARGS__));
>
> It's hard to believe the overhead is worth it.
Which overhead?
next prev parent reply other threads:[~2013-10-15 21:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 20:50 [RFC PATCH 0/3] headers: Consolidate once/cond style macros Frederic Weisbecker
2013-10-15 20:50 ` [PATCH 1/3] core: New macro to execute code only once Frederic Weisbecker
2013-10-15 20:50 ` [PATCH 2/3] core: Convert printk_once to use DO_ONCE Frederic Weisbecker
2013-10-15 21:00 ` Joe Perches
2013-10-15 21:12 ` Frederic Weisbecker [this message]
2013-10-15 21:24 ` Joe Perches
2013-10-16 11:53 ` Frederic Weisbecker
2013-10-16 12:59 ` Steven Rostedt
2013-10-16 13:21 ` Frederic Weisbecker
2013-10-15 20:50 ` [PATCH 3/3] bug: Convert warn macros to use once and cond helpers Frederic Weisbecker
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=20131015211251.GE3269@localhost.localdomain \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chuansheng.liu@intel.com \
--cc=hpa@zytor.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome