<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Hi, there, </div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; ">some user space threads, say thread-X stuck in <span style="font-size: 16px; "> <span style="font-size: 16px; ">sleep_on_page_killable </span>@ filemap_fault()</span>. </div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0,
0); background-color: transparent; font-style: normal; ">my question is : </div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; ">in normal flow, how to wakeup thread-X from wait_on_page_locked_killable() ? How can I go further to debug this issue? </div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; ">I try to use ftrace function_graph to trace the flow, but it can only log EXPORT_SYMBOL_GPL() functions. I am struggling with huge memory and file system source code... </div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; ">hope anyone can give me some practical tips. </div><div style="font-family:
'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; "><br></div><div style="background-color: transparent; "><div style="background-color: transparent; "><div style="background-color: transparent; "><font face="times new roman, new york, times, serif">Call Trace:</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c1895675>] schedule+0x35/0x50</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c1895708>] io_schedule+0x78/0xb0</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c12c95fd>] sleep_on_page_killable+0xd/0x40</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c1895f3f>]
__wait_on_bit+0x4f/0x70</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c12cbcae>] wait_on_page_bit_killable+0x8e/0x90</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c12cbd42>] __lock_page_or_retry+0x92/0xb0</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c12cc041>] filemap_fault+0x2e1/0x400</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c12e55be>] __do_fault+0x3e/0x390</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c12e72ac>] handle_pte_fault+0x7c/0x930</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times,
serif"> [<c12e7bf3>] handle_mm_fault+0x93/0xc0</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c189a98e>] do_page_fault+0x10e/0x4b0</font></div><div style="background-color: transparent; "><font face="times new roman, new york, times, serif"> [<c189881b>] error_code+0x5f/0x64</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal; "><font face="times new roman, new york, times, serif"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal; "><font face="times new roman, new york, times, serif">here is the kernel code in filemap.c </font></div><div style="background-color: transparent; "><font face="times new roman, new
york, times, serif"><div style="background-color: transparent; ">static inline int wait_on_page_locked_killable(struct page *page)</div><div style="background-color: transparent; ">{</div><div style="background-color: transparent; "><span class="Apple-tab-span" style="white-space:pre">        </span>if (PageLocked(page))</div><div style="background-color: transparent; "><span class="Apple-tab-span" style="white-space:pre">                </span>return wait_on_page_bit_killable(page, PG_locked);</div><div style="background-color: transparent; "><span class="Apple-tab-span" style="white-space:pre">        </span>return 0;</div><div style="background-color: transparent; ">}</div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal; ">here is ftrace result: </div><div style="background-color: transparent; "><div
style="background-color: transparent; "> 3) | filemap_fault() {</div><div style="background-color: transparent; "> 3) | find_get_page() {</div><div style="background-color: transparent; "> 3) 0.259 us | __rcu_read_lock();</div><div style="background-color: transparent; "> 3) 0.217 us | __rcu_read_unlock();</div><div style="background-color: transparent; "> 3) 7.432 us | }</div><div style="background-color: transparent; "> 3) 0.244 us | __might_sleep();</div><div style="background-color: transparent; "> 3) + 12.206 us | }</div><div style="color: rgb(0, 0, 0); font-family: 'times new roman', 'new
york', times, serif; font-size: 16px; font-style: normal; "><br></div></div></font></div></div></div> </div></body></html>