public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET] workqueue, writeback: better worker information in task dumps
@ 2013-03-30  3:00 Tejun Heo
  2013-03-30  3:00 ` [PATCH 1/3] kthread: implement probe_kthread_data() Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tejun Heo @ 2013-03-30  3:00 UTC (permalink / raw)
  To: axboe, akpm; +Cc: jack, david, linux-kernel

Hello,

One of the problems that arise when converting dedicated custom
threadpool to workqueue is that the shared worker pool used by
workqueue anonimizes each worker making it more difficult to identify
what the worker was doing on which target from the output of sysrq-t
or debug dump from oops, BUG() and friends.

For example, after writeback is converted to use workqueue instead of
priviate thread pool, there's no easy to tell which backing device a
writeback work item was working on at the time of task dump, which,
according to our writeback brethren, is important in tracking down
issues with a lot of mounted file systems on a lot of different
devices.

This patchset implements a way for a work function to mark its
execution instance so that task dump of the worker task includes
information to indicate what the work item was doing.

An example WARN dump would look like the following.

 WARNING: at /work/os/work/fs/fs-writeback.c:1015 bdi_writeback_workfn+0x2b4/0x3c0()
 Modules linked in:
 Pid: 28, comm: kworker/u18:0 Not tainted 3.9.0-rc1-work+ #24 empty empty/S3992
 Workqueue: writeback bdi_writeback_workfn (flush-8:16)
  ffffffff820a3a98 ffff88015b927cb8 ffffffff81c61855 ffff88015b927cf8
  ffffffff8108f500 0000000000000000 ffff88007a171948 ffff88007a1716b0
  ffff88015b49df00 ffff88015b8d3940 0000000000000000 ffff88015b927d08
 Call Trace:
  [<ffffffff81c61855>] dump_stack+0x19/0x1b
  [<ffffffff8108f500>] warn_slowpath_common+0x70/0xa0
  ...

This patchset contains the following three patches.

 0001-kthread-implement-probe_kthread_data.patch
 0002-workqueue-include-workqueue-info-when-printing-debug.patch
 0003-writeback-set-worker-desc-to-identify-writeback-work.patch

0001 adds a speculative accessor for kthread_data.

0002 implements worker description.

0003 updates writeback to set its flusher name as worker description.

This patchset is on top of

  [1] workqueue: NUMA affinity for unbound workqueues
+ [2] writeback: convert writeback to unbound workqueue
+ [3] arch: unify task dump debug info

and available in the following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-better-dbg

Due to the dependencies, routing this set would be a bit complicated.
I think it would be best to first pull wq/for-3.10 to block tree and
apply workqueue conversion patchset.  The patches in this series then
can go through -mm on top of all three pieces - workqueue, block and
archs.

diffstat follows.  Thanks.

 fs/fs-writeback.c           |    1 
 include/linux/kthread.h     |    1 
 include/linux/workqueue.h   |    5 ++
 kernel/kthread.c            |   19 ++++++++++
 kernel/sched/core.c         |    1 
 kernel/workqueue.c          |   79 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/workqueue_internal.h |   12 ++++++
 lib/dump_stack.c            |    2 +
 8 files changed, 119 insertions(+), 1 deletion(-)

--
tejun

[1] http://thread.gmane.org/gmane.linux.kernel/1465626
[2] http://thread.gmane.org/gmane.linux.kernel/1453006
[3] https://lkml.org/lkml/2013/3/29/354

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCHSET v2] workqueue, writeback: better worker information in task dumps
@ 2013-04-03 19:24 Tejun Heo
  2013-04-03 19:24 ` [PATCH 1/3] kthread: implement probe_kthread_data() Tejun Heo
  0 siblings, 1 reply; 10+ messages in thread
From: Tejun Heo @ 2013-04-03 19:24 UTC (permalink / raw)
  To: axboe, akpm; +Cc: jack, david, linux-kernel

Hello,

Andrew, this one depends on the debug info unification patch and
should be routed through -mm too.  The writeback folks seem to be okay
with the proposed changes although nobody explicitly acked it yet
(please do so).  Please route these together with the previous set
through -mm.  Thanks.

This is v2.  Changes from v1 are,

* Rebased on top of the v2 of "arch: unify task dump debug info"
  patchset.

One of the problems that arise when converting dedicated custom
threadpool to workqueue is that the shared worker pool used by
workqueue anonimizes each worker making it more difficult to identify
what the worker was doing on which target from the output of sysrq-t
or debug dump from oops, BUG() and friends.

For example, after writeback is converted to use workqueue instead of
priviate thread pool, there's no easy to tell which backing device a
writeback work item was working on at the time of task dump, which,
according to our writeback brethren, is important in tracking down
issues with a lot of mounted file systems on a lot of different
devices.

This patchset implements a way for a work function to mark its
execution instance so that task dump of the worker task includes
information to indicate what the work item was doing.

An example WARN dump would look like the following.

 WARNING: at /work/os/work/fs/fs-writeback.c:1015 bdi_writeback_workfn+0x2b4/0x3c0()
 Modules linked in:
 CPU: 0 Pid: 28 Comm: kworker/u18:0 Not tainted 3.9.0-rc1-work+ #24
 Hardware name: empty empty/S3992, BIOS 080011  10/26/2007
 Workqueue: writeback bdi_writeback_workfn (flush-8:16)
  ffffffff820a3a98 ffff88015b927cb8 ffffffff81c61855 ffff88015b927cf8
  ffffffff8108f500 0000000000000000 ffff88007a171948 ffff88007a1716b0
  ffff88015b49df00 ffff88015b8d3940 0000000000000000 ffff88015b927d08
 Call Trace:
  [<ffffffff81c61855>] dump_stack+0x19/0x1b
  [<ffffffff8108f500>] warn_slowpath_common+0x70/0xa0
  ...

This patchset contains the following three patches.

 0001-kthread-implement-probe_kthread_data.patch
 0002-workqueue-include-workqueue-info-when-printing-debug.patch
 0003-writeback-set-worker-desc-to-identify-writeback-work.patch

0001 adds a speculative accessor for kthread_data.

0002 implements worker description.

0003 updates writeback to set its flusher name as worker description.

This patchset is on top of

  akpm as of 2013/04/03
+ [PATCHSET v2] arch: unify task dump debug info

and available in the following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git review-wb-better-dbg

diffstat follows.  Thanks.

 fs/fs-writeback.c           |    1 
 include/linux/kthread.h     |    1 
 include/linux/workqueue.h   |    5 ++
 kernel/kthread.c            |   19 ++++++++++
 kernel/printk.c             |    2 +
 kernel/sched/core.c         |    1 
 kernel/workqueue.c          |   79 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/workqueue_internal.h |   12 ++++++
 8 files changed, 119 insertions(+), 1 deletion(-)

--
tejun

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-03 19:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30  3:00 [PATCHSET] workqueue, writeback: better worker information in task dumps Tejun Heo
2013-03-30  3:00 ` [PATCH 1/3] kthread: implement probe_kthread_data() Tejun Heo
2013-03-30 14:36   ` Oleg Nesterov
2013-03-30 16:17     ` Tejun Heo
2013-03-30 17:00       ` Oleg Nesterov
     [not found]         ` <CAOS58YNMbTY2fZzUXeyLwuA+nowW2AhgLvQwKf_0jWXDen6HzQ@mail.gmail.com>
2013-03-30 19:12           ` Oleg Nesterov
2013-04-03  9:26   ` Jan Kara
2013-03-30  3:00 ` [PATCH 2/3] workqueue: include workqueue info when printing debug dump of a worker task Tejun Heo
2013-03-30  3:00 ` [PATCH 3/3] writeback: set worker desc to identify writeback workers in task dumps Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2013-04-03 19:24 [PATCHSET v2] workqueue, writeback: better worker information " Tejun Heo
2013-04-03 19:24 ` [PATCH 1/3] kthread: implement probe_kthread_data() Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox