<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel/trace/trace_stack.c, branch v4.3-rc4</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>tracing: Clean up stack tracing and fix fentry updates</title>
<updated>2015-07-21T02:30:50+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-07-16T17:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=72ac426a5bb0cec572d26b4456f8c1e14601694e'/>
<id>72ac426a5bb0cec572d26b4456f8c1e14601694e</id>
<content type='text'>
Akashi Takahiro was porting the stack tracer to arm64 and found some
issues with it. One was that it repeats the top function, due to the
stack frame added by the mcount caller and added by itself. This
was added when fentry came in, and before fentry created its own stack
frame. But x86's fentry now creates its own stack frame, and there's
no need to insert the function again.

This also cleans up the code a bit, where it doesn't need to do something
special for fentry, and doesn't include insertion of a duplicate
entry for the called function being traced.

Link: http://lkml.kernel.org/r/55A646EE.6030402@linaro.org

Some-suggestions-by: Jungseok Lee &lt;jungseoklee85@gmail.com&gt;
Some-suggestions-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Reported-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Akashi Takahiro was porting the stack tracer to arm64 and found some
issues with it. One was that it repeats the top function, due to the
stack frame added by the mcount caller and added by itself. This
was added when fentry came in, and before fentry created its own stack
frame. But x86's fentry now creates its own stack frame, and there's
no need to insert the function again.

This also cleans up the code a bit, where it doesn't need to do something
special for fentry, and doesn't include insertion of a duplicate
entry for the called function being traced.

Link: http://lkml.kernel.org/r/55A646EE.6030402@linaro.org

Some-suggestions-by: Jungseok Lee &lt;jungseoklee85@gmail.com&gt;
Some-suggestions-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Reported-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: remove use of seq_printf return value</title>
<updated>2015-04-15T23:35:25+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-04-15T23:18:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=962e3707d9fb16bcf66ec5e5ebcea5248b9c2ab3'/>
<id>962e3707d9fb16bcf66ec5e5ebcea5248b9c2ab3</id>
<content type='text'>
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Miscellanea:

o Remove unused return value from trace_lookup_stack

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Miscellanea:

o Remove unused return value from trace_lookup_stack

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Use IS_ERR() check for return value of tracing_init_dentry()</title>
<updated>2015-01-22T16:19:49+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-01-20T16:14:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=14a5ae40f0def33a422a45b2ed09198adb7bf11c'/>
<id>14a5ae40f0def33a422a45b2ed09198adb7bf11c</id>
<content type='text'>
tracing_init_dentry() will soon return NULL as a valid pointer for the
top level tracing directroy. NULL can not be used as an error value.
Instead, switch to ERR_PTR() and check the return status with
IS_ERR().

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tracing_init_dentry() will soon return NULL as a valid pointer for the
top level tracing directroy. NULL can not be used as an error value.
Instead, switch to ERR_PTR() and check the return status with
IS_ERR().

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Remove unneeded includes of debugfs.h and fs.h</title>
<updated>2015-01-22T16:19:48+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-01-20T16:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3efb5f21a36fbddd524cffe36426a84622ce580e'/>
<id>3efb5f21a36fbddd524cffe36426a84622ce580e</id>
<content type='text'>
The creation of tracing files and directories is for the most part
encapsulated in helper functions in trace.c. Other files do not need to
include debugfs.h or fs.h, as they may have needed to in the past.

Remove them from the files that do not need them.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The creation of tracing files and directories is for the most part
encapsulated in helper functions in trace.c. Other files do not need to
include debugfs.h or fs.h, as they may have needed to in the past.

Remove them from the files that do not need them.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: Add helper for task stack page overrun checking</title>
<updated>2014-09-19T10:35:23+00:00</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2014-09-12T13:16:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a70857e46dd13e87ae06bf0e64cb6a2d4f436265'/>
<id>a70857e46dd13e87ae06bf0e64cb6a2d4f436265</id>
<content type='text'>
This facility is used in a few places so let's introduce
a helper function to improve code readability.

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: aneesh.kumar@linux.vnet.ibm.com
Cc: dzickus@redhat.com
Cc: bmr@redhat.com
Cc: jcastillo@redhat.com
Cc: oleg@redhat.com
Cc: riel@redhat.com
Cc: prarit@redhat.com
Cc: jgh@redhat.com
Cc: minchan@kernel.org
Cc: mpe@ellerman.id.au
Cc: tglx@linutronix.de
Cc: hannes@cmpxchg.org
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1410527779-8133-3-git-send-email-atomlin@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This facility is used in a few places so let's introduce
a helper function to improve code readability.

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: aneesh.kumar@linux.vnet.ibm.com
Cc: dzickus@redhat.com
Cc: bmr@redhat.com
Cc: jcastillo@redhat.com
Cc: oleg@redhat.com
Cc: riel@redhat.com
Cc: prarit@redhat.com
Cc: jgh@redhat.com
Cc: minchan@kernel.org
Cc: mpe@ellerman.id.au
Cc: tglx@linutronix.de
Cc: hannes@cmpxchg.org
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1410527779-8133-3-git-send-email-atomlin@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>init/main.c: Give init_task a canary</title>
<updated>2014-09-19T10:35:22+00:00</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2014-09-12T13:16:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d4311ff1a8da48d609db9500f121c15580dfeeb7'/>
<id>d4311ff1a8da48d609db9500f121c15580dfeeb7</id>
<content type='text'>
Tasks get their end of stack set to STACK_END_MAGIC with the
aim to catch stack overruns. Currently this feature does not
apply to init_task. This patch removes this restriction.

Note that a similar patch was posted by Prarit Bhargava
some time ago but was never merged:

  http://marc.info/?l=linux-kernel&amp;m=127144305403241&amp;w=2

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: aneesh.kumar@linux.vnet.ibm.com
Cc: dzickus@redhat.com
Cc: bmr@redhat.com
Cc: jcastillo@redhat.com
Cc: jgh@redhat.com
Cc: minchan@kernel.org
Cc: tglx@linutronix.de
Cc: hannes@cmpxchg.org
Cc: Alex Thorlton &lt;athorlton@sgi.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Daeseok Youn &lt;daeseok.youn@gmail.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Fabian Frederick &lt;fabf@skynet.be&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Michael Opdenacker &lt;michael.opdenacker@free-electrons.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Vladimir Davydov &lt;vdavydov@parallels.com&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1410527779-8133-2-git-send-email-atomlin@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tasks get their end of stack set to STACK_END_MAGIC with the
aim to catch stack overruns. Currently this feature does not
apply to init_task. This patch removes this restriction.

Note that a similar patch was posted by Prarit Bhargava
some time ago but was never merged:

  http://marc.info/?l=linux-kernel&amp;m=127144305403241&amp;w=2

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: aneesh.kumar@linux.vnet.ibm.com
Cc: dzickus@redhat.com
Cc: bmr@redhat.com
Cc: jcastillo@redhat.com
Cc: jgh@redhat.com
Cc: minchan@kernel.org
Cc: tglx@linutronix.de
Cc: hannes@cmpxchg.org
Cc: Alex Thorlton &lt;athorlton@sgi.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Daeseok Youn &lt;daeseok.youn@gmail.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Fabian Frederick &lt;fabf@skynet.be&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Michael Opdenacker &lt;michael.opdenacker@free-electrons.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Vladimir Davydov &lt;vdavydov@parallels.com&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1410527779-8133-2-git-send-email-atomlin@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Print max callstack on stacktrace bug</title>
<updated>2014-06-02T20:43:49+00:00</updated>
<author>
<name>Minchan Kim</name>
<email>minchan@kernel.org</email>
</author>
<published>2014-06-02T04:33:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e3172181946fadd3bd0e4c362931094ba87e5718'/>
<id>e3172181946fadd3bd0e4c362931094ba87e5718</id>
<content type='text'>
While I played with my own feature(ex, something on the way to reclaim),
the kernel would easily oops. I guessed that the reason had to do with
stack overflow and wanted to prove it.

I discovered the stack tracer which proved to be very useful for me but
the kernel would oops before my user program gather the information via
"watch cat /sys/kernel/debug/tracing/stack_trace" so I couldn't get any
message from that. What I needed was to have the stack tracer emit the
kernel stack usage before it does the oops so I could find what was
hogging the stack.

This patch shows the callstack of max stack usage right before an oops so
we can find a culprit.

So, the result is as follows.

[ 1116.522206] init: lightdm main process (1246) terminated with status 1
[ 1119.922916] init: failsafe-x main process (1272) terminated with status 1
[ 3887.728131] kworker/u24:1 (6637) used greatest stack depth: 256 bytes left
[ 6397.629227] cc1 (9554) used greatest stack depth: 128 bytes left
[ 7174.467392]         Depth    Size   Location    (47 entries)
[ 7174.467392]         -----    ----   --------
[ 7174.467785]   0)     7248     256   get_page_from_freelist+0xa7/0x920
[ 7174.468506]   1)     6992     352   __alloc_pages_nodemask+0x1cd/0xb20
[ 7174.469224]   2)     6640       8   alloc_pages_current+0x10f/0x1f0
[ 7174.469413]   3)     6632     168   new_slab+0x2c5/0x370
[ 7174.469413]   4)     6464       8   __slab_alloc+0x3a9/0x501
[ 7174.469413]   5)     6456      80   __kmalloc+0x1cb/0x200
[ 7174.469413]   6)     6376     376   vring_add_indirect+0x36/0x200
[ 7174.469413]   7)     6000     144   virtqueue_add_sgs+0x2e2/0x320
[ 7174.469413]   8)     5856     288   __virtblk_add_req+0xda/0x1b0
[ 7174.469413]   9)     5568      96   virtio_queue_rq+0xd3/0x1d0
[ 7174.469413]  10)     5472     128   __blk_mq_run_hw_queue+0x1ef/0x440
[ 7174.469413]  11)     5344      16   blk_mq_run_hw_queue+0x35/0x40
[ 7174.469413]  12)     5328      96   blk_mq_insert_requests+0xdb/0x160
[ 7174.469413]  13)     5232     112   blk_mq_flush_plug_list+0x12b/0x140
[ 7174.469413]  14)     5120     112   blk_flush_plug_list+0xc7/0x220
[ 7174.469413]  15)     5008      64   io_schedule_timeout+0x88/0x100
[ 7174.469413]  16)     4944     128   mempool_alloc+0x145/0x170
[ 7174.469413]  17)     4816      96   bio_alloc_bioset+0x10b/0x1d0
[ 7174.469413]  18)     4720      48   get_swap_bio+0x30/0x90
[ 7174.469413]  19)     4672     160   __swap_writepage+0x150/0x230
[ 7174.469413]  20)     4512      32   swap_writepage+0x42/0x90
[ 7174.469413]  21)     4480     320   shrink_page_list+0x676/0xa80
[ 7174.469413]  22)     4160     208   shrink_inactive_list+0x262/0x4e0
[ 7174.469413]  23)     3952     304   shrink_lruvec+0x3e1/0x6a0
[ 7174.469413]  24)     3648      80   shrink_zone+0x3f/0x110
[ 7174.469413]  25)     3568     128   do_try_to_free_pages+0x156/0x4c0
[ 7174.469413]  26)     3440     208   try_to_free_pages+0xf7/0x1e0
[ 7174.469413]  27)     3232     352   __alloc_pages_nodemask+0x783/0xb20
[ 7174.469413]  28)     2880       8   alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  29)     2872     200   __page_cache_alloc+0x13f/0x160
[ 7174.469413]  30)     2672      80   find_or_create_page+0x4c/0xb0
[ 7174.469413]  31)     2592      80   ext4_mb_load_buddy+0x1e9/0x370
[ 7174.469413]  32)     2512     176   ext4_mb_regular_allocator+0x1b7/0x460
[ 7174.469413]  33)     2336     128   ext4_mb_new_blocks+0x458/0x5f0
[ 7174.469413]  34)     2208     256   ext4_ext_map_blocks+0x70b/0x1010
[ 7174.469413]  35)     1952     160   ext4_map_blocks+0x325/0x530
[ 7174.469413]  36)     1792     384   ext4_writepages+0x6d1/0xce0
[ 7174.469413]  37)     1408      16   do_writepages+0x23/0x40
[ 7174.469413]  38)     1392      96   __writeback_single_inode+0x45/0x2e0
[ 7174.469413]  39)     1296     176   writeback_sb_inodes+0x2ad/0x500
[ 7174.469413]  40)     1120      80   __writeback_inodes_wb+0x9e/0xd0
[ 7174.469413]  41)     1040     160   wb_writeback+0x29b/0x350
[ 7174.469413]  42)      880     208   bdi_writeback_workfn+0x11c/0x480
[ 7174.469413]  43)      672     144   process_one_work+0x1d2/0x570
[ 7174.469413]  44)      528     112   worker_thread+0x116/0x370
[ 7174.469413]  45)      416     240   kthread+0xf3/0x110
[ 7174.469413]  46)      176     176   ret_from_fork+0x7c/0xb0
[ 7174.469413] ------------[ cut here ]------------
[ 7174.469413] kernel BUG at kernel/trace/trace_stack.c:174!
[ 7174.469413] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[ 7174.469413] Dumping ftrace buffer:
[ 7174.469413]    (ftrace buffer empty)
[ 7174.469413] Modules linked in:
[ 7174.469413] CPU: 0 PID: 440 Comm: kworker/u24:0 Not tainted 3.14.0+ #212
[ 7174.469413] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 7174.469413] Workqueue: writeback bdi_writeback_workfn (flush-253:0)
[ 7174.469413] task: ffff880034170000 ti: ffff880029518000 task.ti: ffff880029518000
[ 7174.469413] RIP: 0010:[&lt;ffffffff8112336e&gt;]  [&lt;ffffffff8112336e&gt;] stack_trace_call+0x2de/0x340
[ 7174.469413] RSP: 0000:ffff880029518290  EFLAGS: 00010046
[ 7174.469413] RAX: 0000000000000030 RBX: 000000000000002f RCX: 0000000000000000
[ 7174.469413] RDX: 0000000000000000 RSI: 000000000000002f RDI: ffffffff810b7159
[ 7174.469413] RBP: ffff8800295182f0 R08: ffffffffffffffff R09: 0000000000000000
[ 7174.469413] R10: 0000000000000001 R11: 0000000000000001 R12: ffffffff82768dfc
[ 7174.469413] R13: 000000000000f2e8 R14: ffff8800295182b8 R15: 00000000000000f8
[ 7174.469413] FS:  0000000000000000(0000) GS:ffff880037c00000(0000) knlGS:0000000000000000
[ 7174.469413] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 7174.469413] CR2: 00002acd0b994000 CR3: 0000000001c0b000 CR4: 00000000000006f0
[ 7174.469413] Stack:
[ 7174.469413]  0000000000000000 ffffffff8114fdb7 0000000000000087 0000000000001c50
[ 7174.469413]  0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 7174.469413]  0000000000000002 ffff880034170000 ffff880034171028 0000000000000000
[ 7174.469413] Call Trace:
[ 7174.469413]  [&lt;ffffffff8114fdb7&gt;] ? get_page_from_freelist+0xa7/0x920
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff81165065&gt;] ? next_zones_zonelist+0x5/0x70
[ 7174.469413]  [&lt;ffffffff810a23fa&gt;] ? __bfs+0x11a/0x270
[ 7174.469413]  [&lt;ffffffff81165065&gt;] ? next_zones_zonelist+0x5/0x70
[ 7174.469413]  [&lt;ffffffff8114fdb7&gt;] ? get_page_from_freelist+0xa7/0x920
[ 7174.469413]  [&lt;ffffffff8119092f&gt;] ? alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  [&lt;ffffffff811507fd&gt;] __alloc_pages_nodemask+0x1cd/0xb20
[ 7174.469413]  [&lt;ffffffff810a4de6&gt;] ? check_irq_usage+0x96/0xe0
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff8119092f&gt;] alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  [&lt;ffffffff81199cd5&gt;] ? new_slab+0x2c5/0x370
[ 7174.469413]  [&lt;ffffffff81199cd5&gt;] new_slab+0x2c5/0x370
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff816db002&gt;] __slab_alloc+0x3a9/0x501
[ 7174.469413]  [&lt;ffffffff8119af8b&gt;] ? __kmalloc+0x1cb/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] ? vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] ? vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] ? vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8119af8b&gt;] __kmalloc+0x1cb/0x200
[ 7174.469413]  [&lt;ffffffff8141de10&gt;] ? vring_add_indirect+0x200/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8141e402&gt;] virtqueue_add_sgs+0x2e2/0x320
[ 7174.469413]  [&lt;ffffffff8148e35a&gt;] __virtblk_add_req+0xda/0x1b0
[ 7174.469413]  [&lt;ffffffff8148e503&gt;] virtio_queue_rq+0xd3/0x1d0
[ 7174.469413]  [&lt;ffffffff8134aa0f&gt;] __blk_mq_run_hw_queue+0x1ef/0x440
[ 7174.469413]  [&lt;ffffffff8134b0d5&gt;] blk_mq_run_hw_queue+0x35/0x40
[ 7174.469413]  [&lt;ffffffff8134b7bb&gt;] blk_mq_insert_requests+0xdb/0x160
[ 7174.469413]  [&lt;ffffffff8134be5b&gt;] blk_mq_flush_plug_list+0x12b/0x140
[ 7174.469413]  [&lt;ffffffff81342237&gt;] blk_flush_plug_list+0xc7/0x220
[ 7174.469413]  [&lt;ffffffff816e60ef&gt;] ? _raw_spin_unlock_irqrestore+0x3f/0x70
[ 7174.469413]  [&lt;ffffffff816e16e8&gt;] io_schedule_timeout+0x88/0x100
[ 7174.469413]  [&lt;ffffffff816e1665&gt;] ? io_schedule_timeout+0x5/0x100
[ 7174.469413]  [&lt;ffffffff81149415&gt;] mempool_alloc+0x145/0x170
[ 7174.469413]  [&lt;ffffffff8109baf0&gt;] ? __init_waitqueue_head+0x60/0x60
[ 7174.469413]  [&lt;ffffffff811e246b&gt;] bio_alloc_bioset+0x10b/0x1d0
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184110&gt;] get_swap_bio+0x30/0x90
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184660&gt;] __swap_writepage+0x150/0x230
[ 7174.469413]  [&lt;ffffffff810ab405&gt;] ? do_raw_spin_unlock+0x5/0xa0
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184515&gt;] ? __swap_writepage+0x5/0x230
[ 7174.469413]  [&lt;ffffffff81184782&gt;] swap_writepage+0x42/0x90
[ 7174.469413]  [&lt;ffffffff8115ae96&gt;] shrink_page_list+0x676/0xa80
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff8115b872&gt;] shrink_inactive_list+0x262/0x4e0
[ 7174.469413]  [&lt;ffffffff8115c1c1&gt;] shrink_lruvec+0x3e1/0x6a0
[ 7174.469413]  [&lt;ffffffff8115c4bf&gt;] shrink_zone+0x3f/0x110
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff8115c9e6&gt;] do_try_to_free_pages+0x156/0x4c0
[ 7174.469413]  [&lt;ffffffff8115cf47&gt;] try_to_free_pages+0xf7/0x1e0
[ 7174.469413]  [&lt;ffffffff81150db3&gt;] __alloc_pages_nodemask+0x783/0xb20
[ 7174.469413]  [&lt;ffffffff8119092f&gt;] alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  [&lt;ffffffff81145c0f&gt;] ? __page_cache_alloc+0x13f/0x160
[ 7174.469413]  [&lt;ffffffff81145c0f&gt;] __page_cache_alloc+0x13f/0x160
[ 7174.469413]  [&lt;ffffffff81146c6c&gt;] find_or_create_page+0x4c/0xb0
[ 7174.469413]  [&lt;ffffffff811463e5&gt;] ? find_get_page+0x5/0x130
[ 7174.469413]  [&lt;ffffffff812837b9&gt;] ext4_mb_load_buddy+0x1e9/0x370
[ 7174.469413]  [&lt;ffffffff81284c07&gt;] ext4_mb_regular_allocator+0x1b7/0x460
[ 7174.469413]  [&lt;ffffffff81281070&gt;] ? ext4_mb_use_preallocated+0x40/0x360
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff81287eb8&gt;] ext4_mb_new_blocks+0x458/0x5f0
[ 7174.469413]  [&lt;ffffffff8127d83b&gt;] ext4_ext_map_blocks+0x70b/0x1010
[ 7174.469413]  [&lt;ffffffff8124e6d5&gt;] ext4_map_blocks+0x325/0x530
[ 7174.469413]  [&lt;ffffffff81253871&gt;] ext4_writepages+0x6d1/0xce0
[ 7174.469413]  [&lt;ffffffff812531a0&gt;] ? ext4_journalled_write_end+0x330/0x330
[ 7174.469413]  [&lt;ffffffff811539b3&gt;] do_writepages+0x23/0x40
[ 7174.469413]  [&lt;ffffffff811d2365&gt;] __writeback_single_inode+0x45/0x2e0
[ 7174.469413]  [&lt;ffffffff811d36ed&gt;] writeback_sb_inodes+0x2ad/0x500
[ 7174.469413]  [&lt;ffffffff811d39de&gt;] __writeback_inodes_wb+0x9e/0xd0
[ 7174.469413]  [&lt;ffffffff811d40bb&gt;] wb_writeback+0x29b/0x350
[ 7174.469413]  [&lt;ffffffff81057c3d&gt;] ? __local_bh_enable_ip+0x6d/0xd0
[ 7174.469413]  [&lt;ffffffff811d6e9c&gt;] bdi_writeback_workfn+0x11c/0x480
[ 7174.469413]  [&lt;ffffffff81070610&gt;] ? process_one_work+0x170/0x570
[ 7174.469413]  [&lt;ffffffff81070672&gt;] process_one_work+0x1d2/0x570
[ 7174.469413]  [&lt;ffffffff81070610&gt;] ? process_one_work+0x170/0x570
[ 7174.469413]  [&lt;ffffffff81071bb6&gt;] worker_thread+0x116/0x370
[ 7174.469413]  [&lt;ffffffff81071aa0&gt;] ? manage_workers.isra.19+0x2e0/0x2e0
[ 7174.469413]  [&lt;ffffffff81078e53&gt;] kthread+0xf3/0x110
[ 7174.469413]  [&lt;ffffffff81078d60&gt;] ? flush_kthread_worker+0x150/0x150
[ 7174.469413]  [&lt;ffffffff816ef0ec&gt;] ret_from_fork+0x7c/0xb0
[ 7174.469413]  [&lt;ffffffff81078d60&gt;] ? flush_kthread_worker+0x150/0x150
[ 7174.469413] Code: c0 49 bc fc 8d 76 82 ff ff ff ff e8 44 5a 5b 00 31 f6 8b 05 95 2b b3 00 48 39 c6 7d 0e 4c 8b 04 f5 20 5f c5 81 49 83 f8 ff 75 11 &lt;0f&gt; 0b 48 63 05 71 5a 64 01 48 29 c3 e9 d0 fd ff ff 48 8d 5e 01
[ 7174.469413] RIP  [&lt;ffffffff8112336e&gt;] stack_trace_call+0x2de/0x340
[ 7174.469413]  RSP &lt;ffff880029518290&gt;
[ 7174.469413] ---[ end trace c97d325b36b718f3 ]---

Link: http://lkml.kernel.org/p/1401683592-1651-1-git-send-email-minchan@kernel.org

Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While I played with my own feature(ex, something on the way to reclaim),
the kernel would easily oops. I guessed that the reason had to do with
stack overflow and wanted to prove it.

I discovered the stack tracer which proved to be very useful for me but
the kernel would oops before my user program gather the information via
"watch cat /sys/kernel/debug/tracing/stack_trace" so I couldn't get any
message from that. What I needed was to have the stack tracer emit the
kernel stack usage before it does the oops so I could find what was
hogging the stack.

This patch shows the callstack of max stack usage right before an oops so
we can find a culprit.

So, the result is as follows.

[ 1116.522206] init: lightdm main process (1246) terminated with status 1
[ 1119.922916] init: failsafe-x main process (1272) terminated with status 1
[ 3887.728131] kworker/u24:1 (6637) used greatest stack depth: 256 bytes left
[ 6397.629227] cc1 (9554) used greatest stack depth: 128 bytes left
[ 7174.467392]         Depth    Size   Location    (47 entries)
[ 7174.467392]         -----    ----   --------
[ 7174.467785]   0)     7248     256   get_page_from_freelist+0xa7/0x920
[ 7174.468506]   1)     6992     352   __alloc_pages_nodemask+0x1cd/0xb20
[ 7174.469224]   2)     6640       8   alloc_pages_current+0x10f/0x1f0
[ 7174.469413]   3)     6632     168   new_slab+0x2c5/0x370
[ 7174.469413]   4)     6464       8   __slab_alloc+0x3a9/0x501
[ 7174.469413]   5)     6456      80   __kmalloc+0x1cb/0x200
[ 7174.469413]   6)     6376     376   vring_add_indirect+0x36/0x200
[ 7174.469413]   7)     6000     144   virtqueue_add_sgs+0x2e2/0x320
[ 7174.469413]   8)     5856     288   __virtblk_add_req+0xda/0x1b0
[ 7174.469413]   9)     5568      96   virtio_queue_rq+0xd3/0x1d0
[ 7174.469413]  10)     5472     128   __blk_mq_run_hw_queue+0x1ef/0x440
[ 7174.469413]  11)     5344      16   blk_mq_run_hw_queue+0x35/0x40
[ 7174.469413]  12)     5328      96   blk_mq_insert_requests+0xdb/0x160
[ 7174.469413]  13)     5232     112   blk_mq_flush_plug_list+0x12b/0x140
[ 7174.469413]  14)     5120     112   blk_flush_plug_list+0xc7/0x220
[ 7174.469413]  15)     5008      64   io_schedule_timeout+0x88/0x100
[ 7174.469413]  16)     4944     128   mempool_alloc+0x145/0x170
[ 7174.469413]  17)     4816      96   bio_alloc_bioset+0x10b/0x1d0
[ 7174.469413]  18)     4720      48   get_swap_bio+0x30/0x90
[ 7174.469413]  19)     4672     160   __swap_writepage+0x150/0x230
[ 7174.469413]  20)     4512      32   swap_writepage+0x42/0x90
[ 7174.469413]  21)     4480     320   shrink_page_list+0x676/0xa80
[ 7174.469413]  22)     4160     208   shrink_inactive_list+0x262/0x4e0
[ 7174.469413]  23)     3952     304   shrink_lruvec+0x3e1/0x6a0
[ 7174.469413]  24)     3648      80   shrink_zone+0x3f/0x110
[ 7174.469413]  25)     3568     128   do_try_to_free_pages+0x156/0x4c0
[ 7174.469413]  26)     3440     208   try_to_free_pages+0xf7/0x1e0
[ 7174.469413]  27)     3232     352   __alloc_pages_nodemask+0x783/0xb20
[ 7174.469413]  28)     2880       8   alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  29)     2872     200   __page_cache_alloc+0x13f/0x160
[ 7174.469413]  30)     2672      80   find_or_create_page+0x4c/0xb0
[ 7174.469413]  31)     2592      80   ext4_mb_load_buddy+0x1e9/0x370
[ 7174.469413]  32)     2512     176   ext4_mb_regular_allocator+0x1b7/0x460
[ 7174.469413]  33)     2336     128   ext4_mb_new_blocks+0x458/0x5f0
[ 7174.469413]  34)     2208     256   ext4_ext_map_blocks+0x70b/0x1010
[ 7174.469413]  35)     1952     160   ext4_map_blocks+0x325/0x530
[ 7174.469413]  36)     1792     384   ext4_writepages+0x6d1/0xce0
[ 7174.469413]  37)     1408      16   do_writepages+0x23/0x40
[ 7174.469413]  38)     1392      96   __writeback_single_inode+0x45/0x2e0
[ 7174.469413]  39)     1296     176   writeback_sb_inodes+0x2ad/0x500
[ 7174.469413]  40)     1120      80   __writeback_inodes_wb+0x9e/0xd0
[ 7174.469413]  41)     1040     160   wb_writeback+0x29b/0x350
[ 7174.469413]  42)      880     208   bdi_writeback_workfn+0x11c/0x480
[ 7174.469413]  43)      672     144   process_one_work+0x1d2/0x570
[ 7174.469413]  44)      528     112   worker_thread+0x116/0x370
[ 7174.469413]  45)      416     240   kthread+0xf3/0x110
[ 7174.469413]  46)      176     176   ret_from_fork+0x7c/0xb0
[ 7174.469413] ------------[ cut here ]------------
[ 7174.469413] kernel BUG at kernel/trace/trace_stack.c:174!
[ 7174.469413] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[ 7174.469413] Dumping ftrace buffer:
[ 7174.469413]    (ftrace buffer empty)
[ 7174.469413] Modules linked in:
[ 7174.469413] CPU: 0 PID: 440 Comm: kworker/u24:0 Not tainted 3.14.0+ #212
[ 7174.469413] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 7174.469413] Workqueue: writeback bdi_writeback_workfn (flush-253:0)
[ 7174.469413] task: ffff880034170000 ti: ffff880029518000 task.ti: ffff880029518000
[ 7174.469413] RIP: 0010:[&lt;ffffffff8112336e&gt;]  [&lt;ffffffff8112336e&gt;] stack_trace_call+0x2de/0x340
[ 7174.469413] RSP: 0000:ffff880029518290  EFLAGS: 00010046
[ 7174.469413] RAX: 0000000000000030 RBX: 000000000000002f RCX: 0000000000000000
[ 7174.469413] RDX: 0000000000000000 RSI: 000000000000002f RDI: ffffffff810b7159
[ 7174.469413] RBP: ffff8800295182f0 R08: ffffffffffffffff R09: 0000000000000000
[ 7174.469413] R10: 0000000000000001 R11: 0000000000000001 R12: ffffffff82768dfc
[ 7174.469413] R13: 000000000000f2e8 R14: ffff8800295182b8 R15: 00000000000000f8
[ 7174.469413] FS:  0000000000000000(0000) GS:ffff880037c00000(0000) knlGS:0000000000000000
[ 7174.469413] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 7174.469413] CR2: 00002acd0b994000 CR3: 0000000001c0b000 CR4: 00000000000006f0
[ 7174.469413] Stack:
[ 7174.469413]  0000000000000000 ffffffff8114fdb7 0000000000000087 0000000000001c50
[ 7174.469413]  0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 7174.469413]  0000000000000002 ffff880034170000 ffff880034171028 0000000000000000
[ 7174.469413] Call Trace:
[ 7174.469413]  [&lt;ffffffff8114fdb7&gt;] ? get_page_from_freelist+0xa7/0x920
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff81165065&gt;] ? next_zones_zonelist+0x5/0x70
[ 7174.469413]  [&lt;ffffffff810a23fa&gt;] ? __bfs+0x11a/0x270
[ 7174.469413]  [&lt;ffffffff81165065&gt;] ? next_zones_zonelist+0x5/0x70
[ 7174.469413]  [&lt;ffffffff8114fdb7&gt;] ? get_page_from_freelist+0xa7/0x920
[ 7174.469413]  [&lt;ffffffff8119092f&gt;] ? alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  [&lt;ffffffff811507fd&gt;] __alloc_pages_nodemask+0x1cd/0xb20
[ 7174.469413]  [&lt;ffffffff810a4de6&gt;] ? check_irq_usage+0x96/0xe0
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff8119092f&gt;] alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  [&lt;ffffffff81199cd5&gt;] ? new_slab+0x2c5/0x370
[ 7174.469413]  [&lt;ffffffff81199cd5&gt;] new_slab+0x2c5/0x370
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff816db002&gt;] __slab_alloc+0x3a9/0x501
[ 7174.469413]  [&lt;ffffffff8119af8b&gt;] ? __kmalloc+0x1cb/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] ? vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] ? vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] ? vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8119af8b&gt;] __kmalloc+0x1cb/0x200
[ 7174.469413]  [&lt;ffffffff8141de10&gt;] ? vring_add_indirect+0x200/0x200
[ 7174.469413]  [&lt;ffffffff8141dc46&gt;] vring_add_indirect+0x36/0x200
[ 7174.469413]  [&lt;ffffffff8141e402&gt;] virtqueue_add_sgs+0x2e2/0x320
[ 7174.469413]  [&lt;ffffffff8148e35a&gt;] __virtblk_add_req+0xda/0x1b0
[ 7174.469413]  [&lt;ffffffff8148e503&gt;] virtio_queue_rq+0xd3/0x1d0
[ 7174.469413]  [&lt;ffffffff8134aa0f&gt;] __blk_mq_run_hw_queue+0x1ef/0x440
[ 7174.469413]  [&lt;ffffffff8134b0d5&gt;] blk_mq_run_hw_queue+0x35/0x40
[ 7174.469413]  [&lt;ffffffff8134b7bb&gt;] blk_mq_insert_requests+0xdb/0x160
[ 7174.469413]  [&lt;ffffffff8134be5b&gt;] blk_mq_flush_plug_list+0x12b/0x140
[ 7174.469413]  [&lt;ffffffff81342237&gt;] blk_flush_plug_list+0xc7/0x220
[ 7174.469413]  [&lt;ffffffff816e60ef&gt;] ? _raw_spin_unlock_irqrestore+0x3f/0x70
[ 7174.469413]  [&lt;ffffffff816e16e8&gt;] io_schedule_timeout+0x88/0x100
[ 7174.469413]  [&lt;ffffffff816e1665&gt;] ? io_schedule_timeout+0x5/0x100
[ 7174.469413]  [&lt;ffffffff81149415&gt;] mempool_alloc+0x145/0x170
[ 7174.469413]  [&lt;ffffffff8109baf0&gt;] ? __init_waitqueue_head+0x60/0x60
[ 7174.469413]  [&lt;ffffffff811e246b&gt;] bio_alloc_bioset+0x10b/0x1d0
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184110&gt;] get_swap_bio+0x30/0x90
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184660&gt;] __swap_writepage+0x150/0x230
[ 7174.469413]  [&lt;ffffffff810ab405&gt;] ? do_raw_spin_unlock+0x5/0xa0
[ 7174.469413]  [&lt;ffffffff81184230&gt;] ? end_swap_bio_read+0xc0/0xc0
[ 7174.469413]  [&lt;ffffffff81184515&gt;] ? __swap_writepage+0x5/0x230
[ 7174.469413]  [&lt;ffffffff81184782&gt;] swap_writepage+0x42/0x90
[ 7174.469413]  [&lt;ffffffff8115ae96&gt;] shrink_page_list+0x676/0xa80
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff8115b872&gt;] shrink_inactive_list+0x262/0x4e0
[ 7174.469413]  [&lt;ffffffff8115c1c1&gt;] shrink_lruvec+0x3e1/0x6a0
[ 7174.469413]  [&lt;ffffffff8115c4bf&gt;] shrink_zone+0x3f/0x110
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff8115c9e6&gt;] do_try_to_free_pages+0x156/0x4c0
[ 7174.469413]  [&lt;ffffffff8115cf47&gt;] try_to_free_pages+0xf7/0x1e0
[ 7174.469413]  [&lt;ffffffff81150db3&gt;] __alloc_pages_nodemask+0x783/0xb20
[ 7174.469413]  [&lt;ffffffff8119092f&gt;] alloc_pages_current+0x10f/0x1f0
[ 7174.469413]  [&lt;ffffffff81145c0f&gt;] ? __page_cache_alloc+0x13f/0x160
[ 7174.469413]  [&lt;ffffffff81145c0f&gt;] __page_cache_alloc+0x13f/0x160
[ 7174.469413]  [&lt;ffffffff81146c6c&gt;] find_or_create_page+0x4c/0xb0
[ 7174.469413]  [&lt;ffffffff811463e5&gt;] ? find_get_page+0x5/0x130
[ 7174.469413]  [&lt;ffffffff812837b9&gt;] ext4_mb_load_buddy+0x1e9/0x370
[ 7174.469413]  [&lt;ffffffff81284c07&gt;] ext4_mb_regular_allocator+0x1b7/0x460
[ 7174.469413]  [&lt;ffffffff81281070&gt;] ? ext4_mb_use_preallocated+0x40/0x360
[ 7174.469413]  [&lt;ffffffff816eee3f&gt;] ? ftrace_call+0x5/0x2f
[ 7174.469413]  [&lt;ffffffff81287eb8&gt;] ext4_mb_new_blocks+0x458/0x5f0
[ 7174.469413]  [&lt;ffffffff8127d83b&gt;] ext4_ext_map_blocks+0x70b/0x1010
[ 7174.469413]  [&lt;ffffffff8124e6d5&gt;] ext4_map_blocks+0x325/0x530
[ 7174.469413]  [&lt;ffffffff81253871&gt;] ext4_writepages+0x6d1/0xce0
[ 7174.469413]  [&lt;ffffffff812531a0&gt;] ? ext4_journalled_write_end+0x330/0x330
[ 7174.469413]  [&lt;ffffffff811539b3&gt;] do_writepages+0x23/0x40
[ 7174.469413]  [&lt;ffffffff811d2365&gt;] __writeback_single_inode+0x45/0x2e0
[ 7174.469413]  [&lt;ffffffff811d36ed&gt;] writeback_sb_inodes+0x2ad/0x500
[ 7174.469413]  [&lt;ffffffff811d39de&gt;] __writeback_inodes_wb+0x9e/0xd0
[ 7174.469413]  [&lt;ffffffff811d40bb&gt;] wb_writeback+0x29b/0x350
[ 7174.469413]  [&lt;ffffffff81057c3d&gt;] ? __local_bh_enable_ip+0x6d/0xd0
[ 7174.469413]  [&lt;ffffffff811d6e9c&gt;] bdi_writeback_workfn+0x11c/0x480
[ 7174.469413]  [&lt;ffffffff81070610&gt;] ? process_one_work+0x170/0x570
[ 7174.469413]  [&lt;ffffffff81070672&gt;] process_one_work+0x1d2/0x570
[ 7174.469413]  [&lt;ffffffff81070610&gt;] ? process_one_work+0x170/0x570
[ 7174.469413]  [&lt;ffffffff81071bb6&gt;] worker_thread+0x116/0x370
[ 7174.469413]  [&lt;ffffffff81071aa0&gt;] ? manage_workers.isra.19+0x2e0/0x2e0
[ 7174.469413]  [&lt;ffffffff81078e53&gt;] kthread+0xf3/0x110
[ 7174.469413]  [&lt;ffffffff81078d60&gt;] ? flush_kthread_worker+0x150/0x150
[ 7174.469413]  [&lt;ffffffff816ef0ec&gt;] ret_from_fork+0x7c/0xb0
[ 7174.469413]  [&lt;ffffffff81078d60&gt;] ? flush_kthread_worker+0x150/0x150
[ 7174.469413] Code: c0 49 bc fc 8d 76 82 ff ff ff ff e8 44 5a 5b 00 31 f6 8b 05 95 2b b3 00 48 39 c6 7d 0e 4c 8b 04 f5 20 5f c5 81 49 83 f8 ff 75 11 &lt;0f&gt; 0b 48 63 05 71 5a 64 01 48 29 c3 e9 d0 fd ff ff 48 8d 5e 01
[ 7174.469413] RIP  [&lt;ffffffff8112336e&gt;] stack_trace_call+0x2de/0x340
[ 7174.469413]  RSP &lt;ffff880029518290&gt;
[ 7174.469413] ---[ end trace c97d325b36b718f3 ]---

Link: http://lkml.kernel.org/p/1401683592-1651-1-git-send-email-minchan@kernel.org

Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/stack_trace: Skip 4 instead of 3 when using ftrace_ops_list_func</title>
<updated>2014-04-24T17:36:03+00:00</updated>
<author>
<name>Jiaxing Wang</name>
<email>wangjiaxing@insigma.com.cn</email>
</author>
<published>2014-04-20T15:10:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7eea4fce0246fe3a15ad7f3bb8d0a56d1f9440e6'/>
<id>7eea4fce0246fe3a15ad7f3bb8d0a56d1f9440e6</id>
<content type='text'>
When using ftrace_ops_list_func, we should skip 4 instead of 3,
to avoid ftrace_call+0x5/0xb appearing in the stack trace:

        Depth    Size   Location    (110 entries)
        -----    ----   --------
  0)     2956       0   update_curr+0xe/0x1e0
  1)     2956      68   ftrace_call+0x5/0xb
  2)     2888      92   enqueue_entity+0x53/0xe80
  3)     2796      80   enqueue_task_fair+0x47/0x7e0
  4)     2716      28   enqueue_task+0x45/0x70
  5)     2688      12   activate_task+0x22/0x30

Add a function using_ftrace_ops_list_func() to test for this while keeping
ftrace_ops_list_func to remain static.

Link: http://lkml.kernel.org/p/1398006644-5935-2-git-send-email-wangjiaxing@insigma.com.cn

Signed-off-by: Jiaxing Wang &lt;wangjiaxing@insigma.com.cn&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using ftrace_ops_list_func, we should skip 4 instead of 3,
to avoid ftrace_call+0x5/0xb appearing in the stack trace:

        Depth    Size   Location    (110 entries)
        -----    ----   --------
  0)     2956       0   update_curr+0xe/0x1e0
  1)     2956      68   ftrace_call+0x5/0xb
  2)     2888      92   enqueue_entity+0x53/0xe80
  3)     2796      80   enqueue_task_fair+0x47/0x7e0
  4)     2716      28   enqueue_task+0x45/0x70
  5)     2688      12   activate_task+0x22/0x30

Add a function using_ftrace_ops_list_func() to test for this while keeping
ftrace_ops_list_func to remain static.

Link: http://lkml.kernel.org/p/1398006644-5935-2-git-send-email-wangjiaxing@insigma.com.cn

Signed-off-by: Jiaxing Wang &lt;wangjiaxing@insigma.com.cn&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add BUG_ON when stack end location is over written</title>
<updated>2014-03-24T14:39:11+00:00</updated>
<author>
<name>Aaron Tomlin</name>
<email>atomlin@redhat.com</email>
</author>
<published>2014-03-24T14:03:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3862807880acc0adaef6749738d210c9f45c3049'/>
<id>3862807880acc0adaef6749738d210c9f45c3049</id>
<content type='text'>
It is difficult to detect a stack overrun when it
actually occurs.

We have observed that this type of corruption is often
silent and can go unnoticed. Once the corrupted region
is examined, the outcome is undefined and often
results in sporadic system crashes.

When the stack tracing feature is enabled, let's check
for this condition and take appropriate action.

Note: init_task doesn't get its stack end location
set to STACK_END_MAGIC.

Link: http://lkml.kernel.org/r/1395669837-30209-1-git-send-email-atomlin@redhat.com

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is difficult to detect a stack overrun when it
actually occurs.

We have observed that this type of corruption is often
silent and can go unnoticed. Once the corrupted region
is examined, the outcome is undefined and often
results in sporadic system crashes.

When the stack tracing feature is enabled, let's check
for this condition and take appropriate action.

Note: init_task doesn't get its stack end location
set to STACK_END_MAGIC.

Link: http://lkml.kernel.org/r/1395669837-30209-1-git-send-email-atomlin@redhat.com

Signed-off-by: Aaron Tomlin &lt;atomlin@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add generic tracing_lseek() function</title>
<updated>2014-01-02T21:17:12+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-12-21T22:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=098c879e1f2d6ee7afbfe959f6b04070065cec90'/>
<id>098c879e1f2d6ee7afbfe959f6b04070065cec90</id>
<content type='text'>
Trace event triggers added a lseek that uses the ftrace_filter_lseek()
function. Unfortunately, when function tracing is not configured in
that function is not defined and the kernel fails to build.

This is the second time that function was added to a file ops and
it broke the build due to requiring special config dependencies.

Make a generic tracing_lseek() that all the tracing utilities may
use.

Also, modify the old ftrace_filter_lseek() to return 0 instead of
1 on WRONLY. Not sure why it was a 1 as that does not make sense.

This also changes the old tracing_seek() to modify the file pos
pointer on WRONLY as well.

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Tested-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Acked-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trace event triggers added a lseek that uses the ftrace_filter_lseek()
function. Unfortunately, when function tracing is not configured in
that function is not defined and the kernel fails to build.

This is the second time that function was added to a file ops and
it broke the build due to requiring special config dependencies.

Make a generic tracing_lseek() that all the tracing utilities may
use.

Also, modify the old ftrace_filter_lseek() to return 0 instead of
1 on WRONLY. Not sure why it was a 1 as that does not make sense.

This also changes the old tracing_seek() to modify the file pos
pointer on WRONLY as well.

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Tested-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Acked-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
