[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z2UkTMz8bHNN1PMq@pathway.suse.cz>
Date: Fri, 20 Dec 2024 09:01:16 +0100
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: "Rob Herring (Arm)" <robh@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Jonathan Corbet <corbet@....net>,
Saravana Kannan <saravanak@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Zijun Hu <quic_zijuhu@...cinc.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: lock in vsprintf(): was: Re: [PATCH] of: Add printf '%pOFm' for
generating modalias
On Thu 2024-12-19 20:17:21, John Ogness wrote:
> On 2024-12-19, Petr Mladek <pmladek@...e.com> wrote:
> > I do not want to revert everything now just because of theoretical
> > problems.
>
> What would you revert? This has always been an issue for printk().
I did mean the already existing printf modifier which already
take a lock, for example, %pOFC.
> > Well, it would be nice to document the lock dependency in
> > Documentation/core-api/printk-formats.rst
>
> Yes. If any locking is involved at all, such specifiers should be
> documented as not safe in NMI context or within printk_cpu_sync
> blocks. Also, it should be checked if all such locks are
> raw_spinlock_t. If any other lock type is used, it probably is already
> generating a lockdep splat since printk() formats records with local
> interrupts off.
Great point!
> Perhaps we should create a kunit that calls printk() for each of the
> supported specifiers and see if any lockdep splats appear.
It might be possible to somehow reuse the existing module lib/test_printf.c.
Best Regards,
Petr
Powered by blists - more mailing lists