From: Andrew Morton <akpm@linux-foundation.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Michal Marek <mmarek@suse.cz>, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] consolidate WARN_...ONCE() static variables
Date: Wed, 4 Jan 2012 15:03:05 -0800 [thread overview]
Message-ID: <20120104150305.8b2ab00c.akpm@linux-foundation.org> (raw)
In-Reply-To: <4EF3609D0200007800069A30@nat28.tlf.novell.com>
On Thu, 22 Dec 2011 15:53:49 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:
> Due to the alignment of following variables, these typically consume
> more than just the single byte that 'bool' requires, and as there are
> a few hundred instances, the cache pollution (not so much the waste of
> memory) sums op. Put these variables into their own section, outside
> of half way frequently used memory range.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> ---
> include/asm-generic/bug.h | 6 +++---
> include/asm-generic/vmlinux.lds.h | 1 +
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> --- 3.2-rc6/include/asm-generic/bug.h
> +++ 3.2-rc6-warn-once-flag-cold/include/asm-generic/bug.h
> @@ -134,7 +134,7 @@ extern void warn_slowpath_null(const cha
> #endif
>
> #define WARN_ON_ONCE(condition) ({ \
> - static bool __warned; \
> + static bool __section(.data.unlikely) __warned; \
> int __ret_warn_once = !!(condition); \
> \
> if (unlikely(__ret_warn_once)) \
> @@ -144,7 +144,7 @@ extern void warn_slowpath_null(const cha
> })
>
> #define WARN_ONCE(condition, format...) ({ \
> - static bool __warned; \
> + static bool __section(.data.unlikely) __warned; \
> int __ret_warn_once = !!(condition); \
> \
> if (unlikely(__ret_warn_once)) \
> @@ -154,7 +154,7 @@ extern void warn_slowpath_null(const cha
> })
>
> #define WARN_TAINT_ONCE(condition, taint, format...) ({ \
> - static bool __warned; \
> + static bool __section(.data.unlikely) __warned; \
> int __ret_warn_once = !!(condition); \
> \
> if (unlikely(__ret_warn_once)) \
> --- 3.2-rc6/include/asm-generic/vmlinux.lds.h
> +++ 3.2-rc6-warn-once-flag-cold/include/asm-generic/vmlinux.lds.h
> @@ -167,6 +167,7 @@
> CPU_KEEP(exit.data) \
> MEM_KEEP(init.data) \
> MEM_KEEP(exit.data) \
> + *(.data.unlikely) \
> STRUCT_ALIGN(); \
> *(__tracepoints) \
> /* implement dynamic printk debug */ \
The patch seems reasonable.
printk_once() should also be converted. And ata_print_version_once(),
if it insists on continuing to exist. Also rcu_lockdep_assert().
My MUA (sylpheed) is unable to generate a plain-text version of the
patch for me, so much hand-editing will be needed. It would be nice
if the patch could be demangled at the sending end, please.
I agree that linux-kernel should have been cc'ed on a change of this
nature.
next prev parent reply other threads:[~2012-01-04 23:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-22 15:53 [PATCH] consolidate WARN_...ONCE() static variables Jan Beulich
2011-12-22 17:13 ` Arnaud Lacombe
2011-12-23 7:52 ` Jan Beulich
2012-01-04 23:03 ` Andrew Morton [this message]
2012-01-05 11:09 ` Jan Beulich
2012-01-05 21:03 ` Andrew Morton
2012-01-06 7:40 ` Jan Beulich
2012-01-06 11:03 ` Andrew Morton
2012-01-06 12:38 ` Jan Beulich
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=20120104150305.8b2ab00c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=JBeulich@suse.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=mmarek@suse.cz \
/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