From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Petr Mladek <pmladek@suse.cz>, KY Sri nivasan <kys@microsoft.com>,
Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] printk: Hand over printing to console if printing too long
Date: Mon, 11 Jan 2016 22:25:44 +0900 [thread overview]
Message-ID: <20160111132544.GA579@swordfish> (raw)
In-Reply-To: <20160106122517.GC24046@quack.suse.cz>
Hello Jan,
On (01/06/16 13:25), Jan Kara wrote:
[..]
> > a quote from -mm a74b6533ead8 http://www.spinics.net/lists/linux-mm/msg98990.html
[..]
> > particularly this "workqueue context is not appropriate because all the workers
> > might be busy (e.g. allocating memory)" part. I think printk should switch to
> > sync mode in this case, since printk now does queue_work(system_wq, work).
> > um... console_verbose() call from oom kill? but it'll be nice to return back
> > to async mode once (if) memory pressure goes away.
>
> Hum, yes, some mechanism to switch to sync printing in case work cannot be
> executed for a long time is probably needed. I'll think about it.
well, technically, worker_pool keeps ->watchdog_ts updated, so ,basically,
worker pool knows when it stall. with CONFIG_WQ_WATCHDOG enabled timer_fn
wq_watchdog_timer_fn() checks that value and pr_emerg(). in the worst case,
printk can depend on CONFIG_WQ_WATCHDOG (yes, this sounds a bit sad) --
which implies, however, potentially long print from timer_fn. having a
printk() specific timer_fn, that will do the same, is just a duplication of
functionality; and checking the value in every vprintk_emit() is not really
an option too, I'm afraid, there may be no printk calls for some time.
just my 5 cents. probably you have better ideas.
one another thing, include/linux/workqueue.h says
: System-wide workqueues which are always present.
:
: system_wq is the one used by schedule[_delayed]_work[_on]().
: Multi-CPU multi-threaded. There are users which expect relatively
: short queue flush time. Don't queue works which can run for too
: long.
:
[..]
:
: system_long_wq is similar to system_wq but may host long running
: works. Queue flushing might take relatively long.
:
: system_unbound_wq is unbound workqueue. Workers are not bound to
: any specific CPU, not concurrency managed, and all queued works are
: executed immediately as long as max_active limit is not reached and
: resources are available.
wake_up_klogd_work_func() is using `system_wq' to do
'console_lock()/console_unlock()', both of which can take a long time.
should it be switched to `system_long_wq' or `system_unbound_wq'?
-ss
next prev parent reply other threads:[~2016-01-11 13:27 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 14:52 [PATCH 1/7] printk: Hand over printing to console if printing too long Sergey Senozhatsky
2015-12-10 15:24 ` Sergey Senozhatsky
2015-12-11 4:27 ` Sergey Senozhatsky
2015-12-11 6:29 ` Sergey Senozhatsky
2015-12-22 13:47 ` Jan Kara
2015-12-22 14:48 ` Sergey Senozhatsky
2015-12-23 1:54 ` Sergey Senozhatsky
2015-12-23 3:37 ` Sergey Senozhatsky
2015-12-23 3:57 ` Sergey Senozhatsky
2015-12-23 4:15 ` Sergey Senozhatsky
2016-01-05 14:37 ` Jan Kara
2016-01-06 1:41 ` Sergey Senozhatsky
2016-01-06 6:48 ` Sergey Senozhatsky
2016-01-06 12:25 ` Jan Kara
2016-01-11 13:25 ` Sergey Senozhatsky [this message]
2015-12-31 2:44 ` Sergey Senozhatsky
2015-12-31 3:13 ` Sergey Senozhatsky
2015-12-31 4:58 ` Sergey Senozhatsky
2016-01-05 14:48 ` Jan Kara
2016-01-06 3:38 ` Sergey Senozhatsky
2016-01-06 8:36 ` Sergey Senozhatsky
2016-01-06 10:21 ` Jan Kara
2016-01-06 11:10 ` Sergey Senozhatsky
2016-01-11 12:54 ` Petr Mladek
2016-01-12 14:00 ` Jan Kara
-- strict thread matches above, loose matches on Subject: below --
2015-10-26 4:52 [PATCH 0/6 v2] printk: Softlockup avoidance Jan Kara
2015-10-26 4:52 ` [PATCH 1/7] printk: Hand over printing to console if printing too long Jan Kara
2016-03-01 17:22 ` Denys Vlasenko
2016-03-02 9:30 ` Jan Kara
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=20160111132544.GA579@swordfish \
--to=sergey.senozhatsky@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.cz \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky.work@gmail.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;
as well as URLs for NNTP newsgroup(s).