mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: lkp@01.org, LKML <linux-kernel@vger.kernel.org>,
	Kyle McMartin <kyle@kernel.org>,
	Dave Jones <davej@codemonkey.org.uk>, Jan Kara <jack@suse.com>,
	Calvin Owens <calvinowens@fb.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	kernel test robot <ying.huang@linux.intel.com>,
	kernel-team@fb.com,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH] printk: clear console_may_schedule on panic flushing
Date: Mon, 11 Jan 2016 13:59:51 -0800	[thread overview]
Message-ID: <20160111135951.b5f81c02c6d2054164f618af@linux-foundation.org> (raw)
In-Reply-To: <20160111184348.GF1898@mtj.duckdns.org>

On Mon, 11 Jan 2016 13:43:48 -0500 Tejun Heo <tj@kernel.org> wrote:

> Commit "printk: do cond_resched() between lines while outputting to
> consoles" made console flushing perform cond_resched() after each line
> if the context allows as determined by whether the console lock was
> acquired with console_lock().  The condition is carried in
> console_may_schedule.
> 
> During panic, console lock status is ignored and the messages are
> forcifully flushed which is implemented by performing
> console_trylock(); console_unlock(); sequence ignoring whether trylock
> succeeds or fails.  This means that the emergency flushing, after
> trylock failure, may enter flushing path with console_may_schedule set
> from the actual holder.
> 
> As a system may panic from any context, this can lead to
> cond_resched() being invoked from a non-sleepable context triggering
> an extra warning dump while panicking which is noisy and can be
> confusing.  Besides, even when panicking from a sleepable context, we
> don't want to be yielding during emergency message dumping.
> 
> Currently, the emergency dumping is opencoded in panic().  This patch
> replaces the open coded implementation with a new function,
> console_flush_on_panic() and makes it explicitly clear
> console_may_schedule before starting the emergency flushing.
> 

Got that, thanks.  Because the patch has significant information
content I'd normally make it a standalone thing, but as it's destined
for -stable I think I'll scrunch it into
printk-do-cond_resched-between-lines-while-outputting-to-consoles.patch
and merge the changelogs.

You didn't comment on Sergey's observations
(https://lkml.org/lkml/2015/12/2/1192), but I'm believing this is
a separate issue and that this patch is still good.

  reply	other threads:[~2016-01-11 21:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11  3:08 [lkp] [printk] db43e77a44: BUG: sleeping function called from invalid context at kernel/printk/printk.c:2328 kernel test robot
2016-01-11 18:43 ` [PATCH] printk: clear console_may_schedule on panic flushing Tejun Heo
2016-01-11 21:59   ` Andrew Morton [this message]
2016-01-11 22:09     ` Tejun Heo
2016-01-11 22:25       ` Tejun Heo
2016-01-12 13:50     ` Sergey Senozhatsky

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=20160111135951.b5f81c02c6d2054164f618af@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=calvinowens@fb.com \
    --cc=davej@codemonkey.org.uk \
    --cc=jack@suse.com \
    --cc=kernel-team@fb.com \
    --cc=kyle@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=tj@kernel.org \
    --cc=ying.huang@linux.intel.com \
    /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®