printk-hand-over-printing-to-console-if-printing-too-long.patch removed from -mm tree
Subsystems (2)
Subject: [to-be-updated] printk-hand-over-printing-to-console-if-printing-too-long.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 18 Mar 2014 15:43:53 -0700
The patch titled
Subject: printk: hand over printing to console if printing too long
has been removed from the -mm tree. Its filename was
printk-hand-over-printing-to-console-if-printing-too-long.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------
From: Jan Kara <[email protected]>
Subject: printk: hand over printing to console if printing too long
Currently, console_unlock() prints messages from kernel printk buffer to console while the buffer is non-empty. When serial console is attached, printing is slow and thus other CPUs in the system have plenty of time to append new messages to the buffer while one CPU is printing. Thus the CPU can spend unbounded amount of time doing printing in console_unlock(). This is especially serious problem if the printk() calling console_unlock() was called with interrupts disabled.
In practice users have observed a CPU can spend tens of seconds printing in console_unlock() (usually during boot when hundreds of SCSI devices are discovered) resulting in RCU stalls (CPU doing printing doesn't reach quiescent state for a long time), softlockup reports (IPIs for the printing CPU don't get served and thus other CPUs are spinning waiting for the printing CPU to process IPIs), and eventually a machine death (as messages from stalls and lockups append to printk buffer faster than we are able to print). So these machines are unable to boot with serial console attached. Also during artificial stress testing SATA disk disappears from the system because its interrupts aren't served for too long.
This patch implements a mechanism where after printing specified number of characters (tunable as a kernel parameter printk.offload_chars), CPU doing printing asks for help by setting PRINTK_HANDOVER_B bit in printk_handover_state variable and wakes up one of dedicated kthreads. As soon as the printing CPU notices kthread got scheduled and is spinning on console_sem, it drops console_sem and exits console_unlock(). kthread then takes over printing instead. This way no CPU should spend printing too long even if there is heavy printk traffic.
---
Documentation/kernel-parameters.txt | 16 ++ kernel/printk/printk.c | 196 +++++++++++++++++++++++--- 2 files changed, 195 insertions(+), 17 deletions(-)
Documentation/kernel-parameters.txt renamed from Documentation/kernel-parameters.txt~printk-hand-over-printing-to-console-if-printing-too-long +16 -0
@@ -2626,6 +2626,22 @@ bytes respectively. Such letter suffixes Format: <bool> (1/Y/y=enable, 0/N/n=disable) default: disabled + printk.offload_chars= + Printing to console can be relatively slow especially + in case of serial console. When there is intensive + printing happening from several cpus (as is the case + during boot), a cpu can be spending significant time + (seconds or more) doing printing. To avoid softlockups, + lost interrupts, and similar problems other cpus + will take over printing after the currently printing + cpu has printed 'printk.offload_chars' characters. + Higher value means possibly longer interrupt and other + latencies but lower latency of printing and lower + chance something goes wrong during system crash and + important message is not printed. + Format: <number> + default: 0 (disabled) + printk.time= Show timing data prefixed to each printk message line Format: <bool> (1/Y/y=enable, 0/N/n=disable)
kernel/printk/printk.c renamed from kernel/printk/printk.c~printk-hand-over-printing-to-console-if-printing-too-long +179 -17
302 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
backing_dev-fix-hung-task-on-sync.patch backing_dev-fix-hung-task-on-sync-fix.patch bdi-avoid-oops-on-device-removal.patch kthread-ensure-locality-of-task_struct-allocations.patch fanotify-remove-useless-bypass_perm-check.patch fanotify-use-fanotify-event-structure-for-permission-response-processing.patch fanotify-convert-access_mutex-to-spinlock.patch fanotify-reorganize-loop-in-fanotify_read.patch fanotify-move-unrelated-handling-from-copy_event_to_user.patch ocfs2-remove-ocfs2_inode_skip_delete-flag.patch ocfs2-move-dquot_initialize-in-ocfs2_delete_inode-somewhat-later.patch quota-provide-function-to-grab-quota-structure-reference.patch ocfs2-implement-delayed-dropping-of-last-dquot-reference.patch ocfs2-avoid-blocking-in-ocfs2_mark_lockres_freeing-in-downconvert-thread.patch ocfs2-revert-iput-deferring-code-in-ocfs2_drop_dentry_lock.patch mm-vmstat-fix-up-zone-state-accounting.patch fs-cachefiles-use-add_to_page_cache_lru.patch lib-radix-tree-radix_tree_delete_item.patch mm-shmem-save-one-radix-tree-lookup-when-truncating-swapped-pages.patch mm-filemap-move-radix-tree-hole-searching-here.patch mm-fs-prepare-for-non-page-entries-in-page-cache-radix-trees.patch mm-fs-store-shadow-entries-in-page-cache.patch mm-thrash-detection-based-file-cache-sizing.patch lib-radix_tree-tree-node-interface.patch mm-keep-page-cache-radix-tree-nodes-in-check.patch mm-readaheadc-fix-readahead-failure-for-memoryless-numa-nodes-and-limit-readahead-pages.patch fs-mpagec-forgotten-write_sync-in-case-of-data-integrity-write.patch printk-remove-duplicated-check-for-log-level.patch printk-remove-obsolete-check-for-log-level-c.patch printk-add-comment-about-tricky-check-for-text-buffer-size.patch printk-use-also-the-last-bytes-in-the-ring-buffer.patch printk-do-not-compute-the-size-of-the-message-twice.patch kernel-avoid-softlockups-in-stop_machine-during-heavy-printing.patch linux-next.patch
mm-add-strictlimit-knob-v2.patch