|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14 |
|
| #
c1aa3daa |
| 18-Mar-2025 |
Donghyeok Choe <[email protected]> |
printk/panic: Add option to allow non-panic CPUs to write to the ring buffer.
Commit 779dbc2e78d7 ("printk: Avoid non-panic CPUs writing to ringbuffer") aimed to isolate panic-related messages. Howe
printk/panic: Add option to allow non-panic CPUs to write to the ring buffer.
Commit 779dbc2e78d7 ("printk: Avoid non-panic CPUs writing to ringbuffer") aimed to isolate panic-related messages. However, when panic() itself malfunctions, messages from non-panic CPUs become crucial for debugging.
While commit bcc954c6caba ("printk/panic: Allow cpu backtraces to be written into ringbuffer during panic") enables non-panic CPU backtraces, it may not provide sufficient diagnostic information.
Introduce the "debug_non_panic_cpus" command-line option, enabling non-panic CPU messages to be stored in the ring buffer during a panic. This also prevents discarding non-finalized messages from non-panic CPUs during console flushing, providing a more comprehensive view of system state during critical failures.
Link: https://lore.kernel.org/all/Z8cLEkqLL2IOyNIj@pathway/ Signed-off-by: Donghyeok Choe <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] [[email protected]: Added documentation, added module_parameter, removed printk_ prefix.] Tested-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3 |
|
| #
0161e2d6 |
| 09-Dec-2024 |
John Ogness <[email protected]> |
printk: Defer legacy printing when holding printk_cpu_sync
The documentation of printk_cpu_sync_get() clearly states that the owner must never perform any activities where it waits for a CPU. For le
printk: Defer legacy printing when holding printk_cpu_sync
The documentation of printk_cpu_sync_get() clearly states that the owner must never perform any activities where it waits for a CPU. For legacy printing there can be spinning on the console_lock and on the port lock. Therefore legacy printing must be deferred when holding the printk_cpu_sync.
Note that in the case of emergency states, atomic consoles are not prevented from printing when printk is deferred. This is appropriate because they do not spin-wait indefinitely for other CPUs.
Reported-by: Rik van Riel <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: John Ogness <[email protected]> Fixes: 55d6af1d6688 ("lib/nmi_backtrace: explicitly serialize banner and regs") Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7 |
|
| #
ed76c07c |
| 05-Nov-2024 |
Marcos Paulo de Souza <[email protected]> |
printk: Introduce FORCE_CON flag
Introduce FORCE_CON flag to printk. The new flag will make it possible to create a context where printk messages will never be suppressed.
This mechanism will be us
printk: Introduce FORCE_CON flag
Introduce FORCE_CON flag to printk. The new flag will make it possible to create a context where printk messages will never be suppressed.
This mechanism will be used in the next patch to create a force_con context on sysrq handling, removing an existing workaround on the loglevel global variable. The workaround existed to make sure that sysrq header messages were sent to all consoles, but this doesn't work with deferred messages because the loglevel might be restored to its original value before a console flushes the messages.
Signed-off-by: Marcos Paulo de Souza <[email protected]> Reviewed-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
|
Revision tags: v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7 |
|
| #
5f53ca3f |
| 04-Sep-2024 |
John Ogness <[email protected]> |
printk: Implement legacy printer kthread for PREEMPT_RT
The write() callback of legacy consoles usually makes use of spinlocks. This is not permitted with PREEMPT_RT in atomic contexts.
For PREEMPT
printk: Implement legacy printer kthread for PREEMPT_RT
The write() callback of legacy consoles usually makes use of spinlocks. This is not permitted with PREEMPT_RT in atomic contexts.
For PREEMPT_RT, create a new kthread to handle printing of all the legacy consoles (and nbcon consoles if boot consoles are registered). This allows legacy consoles to work on PREEMPT_RT without requiring modification. (However they will not have the reliability properties guaranteed by nbcon atomic consoles.)
Use the existing printk_kthreads_check_locked() to start/stop the legacy kthread as needed.
Introduce the macro force_legacy_kthread() to query if the forced threading of legacy consoles is in effect. Although currently only enabled for PREEMPT_RT, this acts as a simple mechanism for the future to allow other preemption models to easily take advantage of the non-interference property provided by the legacy kthread.
When force_legacy_kthread() is true, the legacy kthread fulfills the role of the console_flush_type @legacy_offload by waking the legacy kthread instead of printing via the console_lock in the irq_work. If the legacy kthread is not yet available, no legacy printing takes place (unless in panic).
If for some reason the legacy kthread fails to create, any legacy consoles are unregistered. With force_legacy_kthread(), the legacy kthread is a critical component for legacy consoles.
These changes only affect CONFIG_PREEMPT_RT.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
5102981d |
| 04-Sep-2024 |
John Ogness <[email protected]> |
printk: nbcon: Show replay message on takeover
An emergency or panic context can takeover console ownership while the current owner was printing a printk message. The atomic printer will re-print th
printk: nbcon: Show replay message on takeover
An emergency or panic context can takeover console ownership while the current owner was printing a printk message. The atomic printer will re-print the message that the previous owner was printing. However, this can look confusing to the user and may even seem as though a message was lost.
[3430014.1 [3430014.181123] usb 1-2: Product: USB Audio
Add a new field @nbcon_prev_seq to struct console to track the sequence number to print that was assigned to the previous console owner. If this matches the sequence number to print that the current owner is assigned, then a takeover must have occurred. In this case, print an additional message to inform the user that the previous message is being printed again.
[3430014.1 ** replaying previous printk message ** [3430014.181123] usb 1-2: Product: USB Audio
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
13189fa7 |
| 04-Sep-2024 |
John Ogness <[email protected]> |
printk: nbcon: Rely on kthreads for normal operation
Once the kthread is running and available (i.e. @printk_kthreads_running is set), the kthread becomes responsible for flushing any pending messag
printk: nbcon: Rely on kthreads for normal operation
Once the kthread is running and available (i.e. @printk_kthreads_running is set), the kthread becomes responsible for flushing any pending messages which are added in NBCON_PRIO_NORMAL context. Namely the legacy console_flush_all() and device_release() no longer flush the console. And nbcon_atomic_flush_pending() used by nbcon_cpu_emergency_exit() no longer flushes messages added after the emergency messages.
The console context is safe when used by the kthread only when one of the following conditions are true:
1. Other caller acquires the console context with NBCON_PRIO_NORMAL with preemption disabled. It will release the context before rescheduling.
2. Other caller acquires the console context with NBCON_PRIO_NORMAL under the device_lock.
3. The kthread is the only context which acquires the console with NBCON_PRIO_NORMAL.
This is satisfied for all atomic printing call sites:
nbcon_legacy_emit_next_record() (#1)
nbcon_atomic_flush_pending_con() (#1)
nbcon_device_release() (#2)
It is even double guaranteed when @printk_kthreads_running is set because then _only_ the kthread will print for NBCON_PRIO_NORMAL. (#3)
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
5c586baa |
| 04-Sep-2024 |
John Ogness <[email protected]> |
printk: nbcon: Use thread callback if in task context for legacy
When printing via console_lock, the write_atomic() callback is used for nbcon consoles. However, if it is known that the current cont
printk: nbcon: Use thread callback if in task context for legacy
When printing via console_lock, the write_atomic() callback is used for nbcon consoles. However, if it is known that the current context is a task context, the write_thread() callback can be used instead.
Using write_thread() instead of write_atomic() helps to reduce large disabled preemption regions when the device_lock does not disable preemption.
This is mainly a preparatory change to allow avoiding write_atomic() completely during normal operation if boot consoles are registered.
As a side-effect, it also allows consolidating the printing code for legacy printing and the kthread printer.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
76f258bf |
| 04-Sep-2024 |
Thomas Gleixner <[email protected]> |
printk: nbcon: Introduce printer kthreads
Provide the main implementation for running a printer kthread per nbcon console that is takeover/handover aware. This includes:
- new mandatory write_threa
printk: nbcon: Introduce printer kthreads
Provide the main implementation for running a printer kthread per nbcon console that is takeover/handover aware. This includes:
- new mandatory write_thread() callback - kthread creation - kthread main printing loop - kthread wakeup mechanism - kthread shutdown
kthread creation is a bit tricky because consoles may register before kthreads can be created. In such cases, registration will succeed, even though no kthread exists. Once kthreads can be created, an early_initcall will set @printk_kthreads_ready. If there are no registered boot consoles, the early_initcall creates the kthreads for all registered nbcon consoles. If kthread creation fails, the related console is unregistered.
If there are registered boot consoles when @printk_kthreads_ready is set, no kthreads are created until the final boot console unregisters.
Once kthread creation finally occurs, @printk_kthreads_running is set so that the system knows kthreads are available for all registered nbcon consoles.
If @printk_kthreads_running is already set when the console is registering, the kthread is created during registration. If kthread creation fails, the registration will fail.
Until @printk_kthreads_running is set, console printing occurs directly via the console_lock.
kthread shutdown on system shutdown/reboot is necessary to ensure the printer kthreads finish their printing so that the system can cleanly transition back to direct printing via the console_lock in order to reliably push out the final shutdown/reboot messages. @printk_kthreads_running is cleared before shutting down the individual kthreads.
The kthread uses a new mandatory write_thread() callback that is called with both device_lock() and the console context acquired.
The console ownership handling is necessary for synchronization against write_atomic() which is synchronized only via the console context ownership.
The device_lock() serializes acquiring the console context with NBCON_PRIO_NORMAL. It is needed in case the device_lock() does not disable preemption. It prevents the following race:
CPU0 CPU1
[ task A ]
nbcon_context_try_acquire() # success with NORMAL prio # .unsafe == false; // safe for takeover
[ schedule: task A -> B ]
WARN_ON() nbcon_atomic_flush_pending() nbcon_context_try_acquire() # success with EMERGENCY prio
# flushing nbcon_context_release()
# HERE: con->nbcon_state is free # to take by anyone !!!
nbcon_context_try_acquire() # success with NORMAL prio [ task B ]
[ schedule: task B -> A ]
nbcon_enter_unsafe() nbcon_context_can_proceed()
BUG: nbcon_context_can_proceed() returns "true" because the console is owned by a context on CPU0 with NBCON_PRIO_NORMAL.
But it should return "false". The console is owned by a context from task B and we do the check in a context from task A.
Note that with these changes, the printer kthreads do not yet take over full responsibility for nbcon printing during normal operation. These changes only focus on the lifecycle of the kthreads.
Co-developed-by: John Ogness <[email protected]> Signed-off-by: John Ogness <[email protected]> Signed-off-by: Thomas Gleixner (Intel) <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
6cb58cfe |
| 04-Sep-2024 |
John Ogness <[email protected]> |
printk: nbcon: Add context to usable() and emit()
The nbcon consoles will have two callbacks to be used for different contexts. In order to determine if an nbcon console is usable, console_is_usable
printk: nbcon: Add context to usable() and emit()
The nbcon consoles will have two callbacks to be used for different contexts. In order to determine if an nbcon console is usable, console_is_usable() must know if it is a context that will need to use the optional write_atomic() callback. Also, nbcon_emit_next_record() must know which callback it needs to call.
Add an extra parameter @use_atomic to console_is_usable() and nbcon_emit_next_record() to specify this.
Since so far only the write_atomic() callback exists, @use_atomic is set to true for all call sites.
For legacy consoles, @use_atomic is not used.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc6, v6.11-rc5 |
|
| #
ecb5e1aa |
| 20-Aug-2024 |
Thomas Gleixner <[email protected]> |
printk: nbcon: Implement emergency sections
In emergency situations (something has gone wrong but the system continues to operate), usually important information (such as a backtrace) is generated v
printk: nbcon: Implement emergency sections
In emergency situations (something has gone wrong but the system continues to operate), usually important information (such as a backtrace) is generated via printk(). This information should be pushed out to the consoles ASAP.
Add per-CPU emergency nesting tracking because an emergency can arise while in an emergency situation.
Add functions to mark the beginning and end of emergency sections where the urgent messages are generated.
Perform direct console flushing at the emergency priority if the current CPU is in an emergency state and it is safe to do so.
Note that the emergency state is not system-wide. While one CPU is in an emergency state, another CPU may attempt to print console messages at normal priority.
Also note that printk() already attempts to flush consoles in the caller context for normal priority. However, follow-up changes will introduce printing kthreads, in which case the normal priority printk() calls will offload to the kthreads.
Co-developed-by: John Ogness <[email protected]> Signed-off-by: John Ogness <[email protected]> Signed-off-by: Thomas Gleixner (Intel) <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
6690d6b5 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: Add helper for flush type logic
There are many call sites where console flushing occur. Depending on the system state and types of consoles, the flush methods to use are different. A flush c
printk: Add helper for flush type logic
There are many call sites where console flushing occur. Depending on the system state and types of consoles, the flush methods to use are different. A flush call site generally must consider:
@have_boot_console @have_nbcon_console @have_legacy_console @legacy_allow_panic_sync is_printk_preferred()
and take into account the current CPU state:
NBCON_PRIO_NORMAL NBCON_PRIO_EMERGENCY NBCON_PRIO_PANIC
in order to decide if it should:
flush nbcon directly via atomic_write() callback flush legacy directly via console_unlock flush legacy via offload to irq_work
All of these call sites use their own logic to make this decision, which is complicated and error prone. Especially later when two more flush methods will be introduced:
flush nbcon via offload to kthread flush legacy via offload to kthread
Introduce a new internal struct console_flush_type that specifies which console flushing methods should be used in the context of the caller.
Introduce a helper function to fill out console_flush_type to be used for flushing call sites.
Replace the logic of all flushing call sites to use the new helper.
This change standardizes behavior, leading to both fixes and optimizations across various call sites. For instance, in console_cpu_notify(), the new logic ensures that nbcon consoles are flushed when they aren’t managed by the legacy loop. Similarly, in console_flush_on_panic(), the system no longer needs to flush nbcon consoles if none are present.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] [[email protected]: Updated the commit message.] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
e35a8884 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: Coordinate direct printing in panic
If legacy and nbcon consoles are registered and the nbcon consoles are allowed to flush (i.e. no boot consoles registered), the legacy consoles will no lo
printk: Coordinate direct printing in panic
If legacy and nbcon consoles are registered and the nbcon consoles are allowed to flush (i.e. no boot consoles registered), the legacy consoles will no longer perform direct printing on the panic CPU until after the backtrace has been stored. This will give the safe nbcon consoles a chance to print the panic messages before allowing the unsafe legacy consoles to print.
If no nbcon consoles are registered or they are not allowed to flush because boot consoles are registered, there is no change in behavior (i.e. legacy consoles will always attempt to print from the printk() caller context).
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
8ba77712 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: nbcon: Flush new records on device_release()
There may be new records that were added while a driver was holding the nbcon context for non-printing purposes. These new records must be flushe
printk: nbcon: Flush new records on device_release()
There may be new records that were added while a driver was holding the nbcon context for non-printing purposes. These new records must be flushed by the nbcon_device_release() context because no other context will do it.
If boot consoles are registered, the legacy loop is used (either direct or per irq_work) to handle the flushing.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
70411bf8 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: Add is_printk_legacy_deferred()
If printk has been explicitly deferred or is called from NMI context, legacy console printing must be deferred to an irq_work context. Introduce a helper func
printk: Add is_printk_legacy_deferred()
If printk has been explicitly deferred or is called from NMI context, legacy console printing must be deferred to an irq_work context. Introduce a helper function is_printk_legacy_deferred() for a CPU to query if it must defer legacy console printing.
In follow-up commits this helper will be needed at other call sites as well.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
c158834b |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: nbcon: Use nbcon consoles in console_flush_all()
Allow nbcon consoles to print messages in the legacy printk() caller context (printing via unlock) by integrating them into console_flush_all
printk: nbcon: Use nbcon consoles in console_flush_all()
Allow nbcon consoles to print messages in the legacy printk() caller context (printing via unlock) by integrating them into console_flush_all(). The write_atomic() callback is used for printing.
Provide nbcon_legacy_emit_next_record(), which acts as the nbcon variant of console_emit_next_record(). Call this variant within console_flush_all() for nbcon consoles. Since nbcon consoles use their own @nbcon_seq variable to track the next record to print, this also must be appropriately handled in console_flush_all().
Note that the legacy printing logic uses @handover to detect handovers for printing all consoles. For nbcon consoles, handovers/takeovers occur on a per-console basis and thus do not cause the console_flush_all() loop to abort.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
d3a9f82e |
| 20-Aug-2024 |
Thomas Gleixner <[email protected]> |
printk: nbcon: Provide function to flush using write_atomic()
Provide nbcon_atomic_flush_pending() to perform flushing of all registered nbcon consoles using their write_atomic() callback.
Unlike c
printk: nbcon: Provide function to flush using write_atomic()
Provide nbcon_atomic_flush_pending() to perform flushing of all registered nbcon consoles using their write_atomic() callback.
Unlike console_flush_all(), nbcon_atomic_flush_pending() will only flush up through the newest record at the time of the call. This prevents a CPU from printing unbounded when other CPUs are adding records. If new records are added while flushing, it is expected that the dedicated printer threads will print those records. If the printer thread is not available (which is always the case at this point in the rework), nbcon_atomic_flush_pending() _will_ flush all records in the ringbuffer.
Unlike console_flush_all(), nbcon_atomic_flush_pending() will fully flush one console before flushing the next. This helps to guarantee that a block of pending records (such as a stack trace in an emergency situation) can be printed atomically at once before releasing console ownership.
nbcon_atomic_flush_pending() is safe in any context because it uses write_atomic() and acquires with unsafe_takeover disabled.
Co-developed-by: John Ogness <[email protected]> Signed-off-by: John Ogness <[email protected]> Signed-off-by: Thomas Gleixner (Intel) <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
06683a66 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: nbcon: Add helper to assign priority based on CPU state
Add a helper function to use the current state of the CPU to determine which priority to assign to the printing context.
The EMERGENC
printk: nbcon: Add helper to assign priority based on CPU state
Add a helper function to use the current state of the CPU to determine which priority to assign to the printing context.
The EMERGENCY priority handling is added in a follow-up commit. It will use a per-CPU variable.
Note: nbcon_device_try_acquire(), which is used by console drivers to acquire the nbcon console for non-printing activities, is hard-coded to always use NORMAL priority.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
fc400d5f |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: Add @flags argument for console_is_usable()
The caller of console_is_usable() usually needs @console->flags for its own checks. Rather than having console_is_usable() read its own copy, make
printk: Add @flags argument for console_is_usable()
The caller of console_is_usable() usually needs @console->flags for its own checks. Rather than having console_is_usable() read its own copy, make the caller pass in the @flags. This also ensures that the caller saw the same @flags value.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
20846d1c |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: Let console_is_usable() handle nbcon
The nbcon consoles use a different printing callback. For nbcon consoles, check for the write_atomic() callback instead of write().
Signed-off-by: John
printk: Let console_is_usable() handle nbcon
The nbcon consoles use a different printing callback. For nbcon consoles, check for the write_atomic() callback instead of write().
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
864c25c8 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: Make console_is_usable() available to nbcon.c
Move console_is_usable() as-is into internal.h so that it can be used by nbcon printing functions as well.
Signed-off-by: John Ogness <john.ogn
printk: Make console_is_usable() available to nbcon.c
Move console_is_usable() as-is into internal.h so that it can be used by nbcon printing functions as well.
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
1c17ebb7 |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: nbcon: Do not rely on proxy headers
The headers kernel.h, serial_core.h, and console.h allow for the definitions of many types and functions from other headers. Rather than relying on these
printk: nbcon: Do not rely on proxy headers
The headers kernel.h, serial_core.h, and console.h allow for the definitions of many types and functions from other headers. Rather than relying on these as proxy headers, explicitly include all headers providing needed definitions. Also sort the list alphabetically to be able to easily detect duplicates.
Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: John Ogness <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
0e1d5731 |
| 20-Aug-2024 |
Sebastian Andrzej Siewior <[email protected]> |
printk: Check printk_deferred_enter()/_exit() usage
Add validation that printk_deferred_enter()/_exit() are called in non-migration contexts.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linut
printk: Check printk_deferred_enter()/_exit() usage
Add validation that printk_deferred_enter()/_exit() are called in non-migration contexts.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| #
f37b105f |
| 20-Aug-2024 |
John Ogness <[email protected]> |
printk: nbcon: Consolidate alloc() and init()
Rather than splitting the nbcon allocation and initialization into two pieces, perform all initialization in nbcon_alloc(). Later, the initial sequence
printk: nbcon: Consolidate alloc() and init()
Rather than splitting the nbcon allocation and initialization into two pieces, perform all initialization in nbcon_alloc(). Later, the initial sequence is calculated and can be explicitly set using nbcon_seq_force(). This removes the need for the strong rules of nbcon_init() that even included a BUG_ON().
Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1 |
|
| #
78eb4ea2 |
| 24-Jul-2024 |
Joel Granados <[email protected]> |
sysctl: treewide: constify the ctl_table argument of proc_handlers
const qualify the struct ctl_table argument in the proc_handler function signatures. This is a prerequisite to moving the static ct
sysctl: treewide: constify the ctl_table argument of proc_handlers
const qualify the struct ctl_table argument in the proc_handler function signatures. This is a prerequisite to moving the static ctl_table structs into .rodata data which will ensure that proc_handler function pointers cannot be modified.
This patch has been generated by the following coccinelle script:
``` virtual patch
@r1@ identifier ctl, write, buffer, lenp, ppos; identifier func !~ "appldata_(timer|interval)_handler|sched_(rt|rr)_handler|rds_tcp_skbuf_handler|proc_sctp_do_(hmac_alg|rto_min|rto_max|udp_port|alpha_beta|auth|probe_interval)"; @@
int func( - struct ctl_table *ctl + const struct ctl_table *ctl ,int write, void *buffer, size_t *lenp, loff_t *ppos);
@r2@ identifier func, ctl, write, buffer, lenp, ppos; @@
int func( - struct ctl_table *ctl + const struct ctl_table *ctl ,int write, void *buffer, size_t *lenp, loff_t *ppos) { ... }
@r3@ identifier func; @@
int func( - struct ctl_table * + const struct ctl_table * ,int , void *, size_t *, loff_t *);
@r4@ identifier func, ctl; @@
int func( - struct ctl_table *ctl + const struct ctl_table *ctl ,int , void *, size_t *, loff_t *);
@r5@ identifier func, write, buffer, lenp, ppos; @@
int func( - struct ctl_table * + const struct ctl_table * ,int write, void *buffer, size_t *lenp, loff_t *ppos);
```
* Code formatting was adjusted in xfs_sysctl.c to comply with code conventions. The xfs_stats_clear_proc_handler, xfs_panic_mask_proc_handler and xfs_deprecated_dointvec_minmax where adjusted.
* The ctl_table argument in proc_watchdog_common was const qualified. This is called from a proc_handler itself and is calling back into another proc_handler, making it necessary to change it as part of the proc_handler migration.
Co-developed-by: Thomas Weißschuh <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]> Co-developed-by: Joel Granados <[email protected]> Signed-off-by: Joel Granados <[email protected]>
show more ...
|
|
Revision tags: v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4 |
|
| #
7412dc6d |
| 07-Feb-2024 |
John Ogness <[email protected]> |
dump_stack: Do not get cpu_sync for panic CPU
dump_stack() is called in panic(). If for some reason another CPU is holding the printk_cpu_sync and is unable to release it, the panic CPU will be unab
dump_stack: Do not get cpu_sync for panic CPU
dump_stack() is called in panic(). If for some reason another CPU is holding the printk_cpu_sync and is unable to release it, the panic CPU will be unable to continue and print the stacktrace.
Since non-panic CPUs are not allowed to store new printk messages anyway, there is no need to synchronize the stacktrace output in a panic situation.
For the panic CPU, do not get the printk_cpu_sync because it is not needed and avoids a potential deadlock scenario in panic().
Link: https://lore.kernel.org/lkml/ZcIGKU8sxti38Kok@alley Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|