From: Petr Mladek <pmladek@suse.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: John Ogness <john.ogness@linutronix.de>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Chris Down <chris@chrisdown.name>, Marc Zyngier <maz@kernel.org>,
Andrew Scull <ascull@google.com>, Will Deacon <will@kernel.org>,
Jason Baron <jbaron@akamai.com>,
Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.com>
Subject: [RFC 0/2] printk: Remove cyclic include dependencies with printk.h
Date: Tue, 11 Jan 2022 15:30:44 +0100 [thread overview]
Message-ID: <20220111143046.14680-1-pmladek@suse.com> (raw)
"make headerdep" reports two cycles where printk.h is involved. Both are
a bit complicated. All involved headers provide inlined functions that
have to be inlined because they add caller-specific metadata.
There are several possible solutions:
1. Ignore the problem because the cycles do not cause any real problem
at the moment. I would say that it works by chance. See the patches
for more details.
2. Move the printk-calls from the headers into .c sources so that printk.h
is included in .c instead of .h. It is relatively easy except that it
makes the code a bit more complicated.
3. Use a simple declaration somewhere. It is problematic because
the inlined functions are more complex.
But printk() is complex because it adds metadata for the list
of strings in /sys/kernel/debug/printk/index. The index already misses
a lot of strings that are printed via some subsystem specific wrappers.
It should be acceptable to miss the few strings used in the affected
headers.
This patchset implements the 3rd solution. It does not complicate
the existing code. It is quite the opposite. It splits the long
printk.h. It puts some low-level definitions into separate printk_core.h.
The lightweight header file might be useful also in other situations.
What do you think, please?
Petr Mladek (2):
printk/dynamic_debug: Remove cyclic dependency between printk.h and
dynamic_debug.h
printk/bug: Remove cyclic dependency between bug.h and printk.h
MAINTAINERS | 1 +
include/asm-generic/bug.h | 4 +-
include/linux/dynamic_debug.h | 10 ++--
include/linux/printk.h | 68 +--------------------------
include/linux/printk_core.h | 87 +++++++++++++++++++++++++++++++++++
5 files changed, 96 insertions(+), 74 deletions(-)
create mode 100644 include/linux/printk_core.h
--
2.26.2
next reply other threads:[~2022-01-11 14:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 14:30 Petr Mladek [this message]
2022-01-11 14:30 ` [RFC 1/2] printk/dynamic_debug: Remove cyclic dependency between printk.h and dynamic_debug.h Petr Mladek
2022-01-11 14:53 ` Chris Down
2022-01-11 16:01 ` Rasmus Villemoes
2022-01-12 12:12 ` Petr Mladek
2022-01-13 3:38 ` jim.cromie
2022-01-13 8:35 ` Petr Mladek
2022-01-17 22:39 ` jim.cromie
2022-01-13 9:02 ` Rasmus Villemoes
2022-01-11 14:30 ` [RFC 2/2] printk/bug: Remove cyclic dependency between bug.h and printk.h Petr Mladek
2022-01-11 14:54 ` Chris Down
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=20220111143046.14680-1-pmladek@suse.com \
--to=pmladek@suse.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ascull@google.com \
--cc=chris@chrisdown.name \
--cc=jbaron@akamai.com \
--cc=john.ogness@linutronix.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=maz@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=will@kernel.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