The patch titled Subject: kdb: remove unused kdb_event handling has been added to the -mm tree. Its filename is kdb-remove-unused-kdb_event-handling.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kdb-remove-unused-kdb_event-handling.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kdb-remove-unused-kdb_event-handling.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Petr Mladek <pmladek@xxxxxxxx> Subject: kdb: remove unused kdb_event handling kdb_event state variable is only set but never checked in the kernel code. http://www.spinics.net/lists/kdb/msg01733.html suggests that this variable affected WARN_CONSOLE_UNLOCKED() in the original implementation. But this check never went upstream. The semantic is unclear and racy. The value is updated after the kdb_printf_lock is acquired and after it is released. It should be symmetric at minimum. The value should be manipulated either inside or outside the locked area. Fortunately, it seems that the original function is gone and we could simply remove the state variable. Link: http://lkml.kernel.org/r/1480412276-16690-2-git-send-email-pmladek@xxxxxxxx Signed-off-by: Petr Mladek <pmladek@xxxxxxxx> Suggested-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx> Cc: Jason Wessel <jason.wessel@xxxxxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/kdb.h | 1 - kernel/debug/kdb/kdb_io.c | 2 -- kernel/debug/kdb/kdb_main.c | 1 - 3 files changed, 4 deletions(-) diff -puN include/linux/kdb.h~kdb-remove-unused-kdb_event-handling include/linux/kdb.h --- a/include/linux/kdb.h~kdb-remove-unused-kdb_event-handling +++ a/include/linux/kdb.h @@ -77,7 +77,6 @@ extern int kdb_poll_idx; * number whenever the kernel debugger is entered. */ extern int kdb_initial_cpu; -extern atomic_t kdb_event; /* Types and messages used for dynamically added kdb shell commands */ diff -puN kernel/debug/kdb/kdb_io.c~kdb-remove-unused-kdb_event-handling kernel/debug/kdb/kdb_io.c --- a/kernel/debug/kdb/kdb_io.c~kdb-remove-unused-kdb_event-handling +++ a/kernel/debug/kdb/kdb_io.c @@ -576,7 +576,6 @@ int vkdb_printf(enum kdb_msgsrc src, con KDB_STATE_SET(PRINTF_LOCK); spin_lock_irqsave(&kdb_printf_lock, flags); got_printf_lock = 1; - atomic_inc(&kdb_event); } else { __acquire(kdb_printf_lock); } @@ -851,7 +850,6 @@ kdb_print_out: got_printf_lock = 0; spin_unlock_irqrestore(&kdb_printf_lock, flags); KDB_STATE_CLEAR(PRINTF_LOCK); - atomic_dec(&kdb_event); } else { __release(kdb_printf_lock); } diff -puN kernel/debug/kdb/kdb_main.c~kdb-remove-unused-kdb_event-handling kernel/debug/kdb/kdb_main.c --- a/kernel/debug/kdb/kdb_main.c~kdb-remove-unused-kdb_event-handling +++ a/kernel/debug/kdb/kdb_main.c @@ -60,7 +60,6 @@ int kdb_grep_trailing; * Kernel debugger state flags */ int kdb_flags; -atomic_t kdb_event; /* * kdb_lock protects updates to kdb_initial_cpu. Used to _ Patches currently in -mm which might be from pmladek@xxxxxxxx are printk-nmi-handle-continuous-lines-and-missing-newline.patch printk-kdb-handle-more-message-headers.patch printk-btrfs-handle-more-message-headers.patch printk-btrfs-handle-more-message-headers-fix.patch printk-sound-handle-more-message-headers.patch printk-sound-handle-more-message-headers-fix.patch kdb-remove-unused-kdb_event-handling.patch kdb-properly-synchronize-vkdb_printf-calls-with-other-cpus.patch kdb-call-vkdb_printf-from-vprintk_default-only-when-wanted.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html