Re: lock in vsprintf(): was: Re: [PATCH] of: Add printf '%pOFm' for generating modalias

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024-12-18, Petr Mladek <pmladek@xxxxxxxx> wrote:
> My concern is taking a lock when processing a printf format, see
> below for more details.

Your concern is valid! printk() uses vsnprintf() to format records for
the kernel log. printk() may be called from contexts where locking is
forbidden (such as NMI). If vsnprintf() can take a lock, then either:

vsnprintf() must be made to be lockless

  or

printk() must take another approach to string formatting

  or

we accept that printk() can deadlock for certain format types in certain
contexts.

John Ogness




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux