mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	James Hogan <james.hogan@imgtec.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 2/2] printk: Provide a wake_up_klogd() off-case
Date: Thu, 14 Mar 2013 13:39:31 -0700	[thread overview]
Message-ID: <20130314133931.3609b75deff58a2df02ca96b@linux-foundation.org> (raw)
In-Reply-To: <1363271189-6631-3-git-send-email-fweisbec@gmail.com>

On Thu, 14 Mar 2013 15:26:29 +0100 Frederic Weisbecker <fweisbec@gmail.com> wrote:

> wake_up_klogd() is useless when CONFIG_PRINTK=n because
> neither printk() nor printk_sched() are in use and there
> are actually no waiter on log_wait waitqueue. It should
> be a stub in this case for users like bust_spinlocks().
> 
> Otherwise this results in this warning when CONFIG_PRINTK=n
> and CONFIG_IRQ_WORK=n:
> 
> 	kernel/built-in.o In function `wake_up_klogd':
> 	(.text.wake_up_klogd+0xb4): undefined reference to `irq_work_queue'
> 
> To fix this, provide an off-case for wake_up_klogd() when
> CONFIG_PRINTK=n.
> 
> There is much more from console_unlock() and other console
> related code in printk.c that should be moved under
> CONFIG_PRINTK. But for now, focus on a minimal fix as we passed
> the merged window already.
> 
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -390,7 +390,6 @@ extern struct pid *session_of_pgrp(struct pid *pgrp);
>  unsigned long int_sqrt(unsigned long);
>  
>  extern void bust_spinlocks(int yes);
> -extern void wake_up_klogd(void);
>  extern int oops_in_progress;		/* If set, an oops, panic(), BUG() or die() is in progress */
>  extern int panic_timeout;
>  extern int panic_on_oops;
> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index 1249a54..822171f 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -134,6 +134,8 @@ extern int printk_delay_msec;
>  extern int dmesg_restrict;
>  extern int kptr_restrict;
>  
> +extern void wake_up_klogd(void);
> +

Given this, it would be prudent to include printk.h in
bust_spinlocks.c.  printk.h currently gets included by kernel.h, but
that doesn't actually seem necessary - nothing in kernel.h calls
printk().

(I pity anyone who tries to remove that include from kernel.h ;))

--- a/lib/bust_spinlocks.c~printk-provide-a-wake_up_klogd-off-case-fix
+++ a/lib/bust_spinlocks.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/printk.h>
 #include <linux/spinlock.h>
 #include <linux/tty.h>
 #include <linux/wait.h>
@@ -28,5 +29,3 @@ void __attribute__((weak)) bust_spinlock
 			wake_up_klogd();
 	}
 }
-
-
_


  reply	other threads:[~2013-03-14 20:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 14:26 [GIT PULL] printk: fixes Frederic Weisbecker
2013-03-14 14:26 ` [PATCH 1/2] irq_work.h: fix warning when CONFIG_IRQ_WORK=n Frederic Weisbecker
2013-03-14 14:26 ` [PATCH 2/2] printk: Provide a wake_up_klogd() off-case Frederic Weisbecker
2013-03-14 20:39   ` Andrew Morton [this message]
2013-03-14 22:21     ` Frederic Weisbecker
2013-03-14 22:24     ` Paul Gortmaker
2013-03-14 22:34       ` Frederic Weisbecker
2013-03-14 22:45         ` Paul Gortmaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130314133931.3609b75deff58a2df02ca96b@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®