testcase ========
test kernel :: latest cosmic version + patch: --------------------------------------------
$ uname -rv 4.18.0-18-generic #19+test20190415b1 SMP Mon Apr 15 15:43:20 UTC 2019
[ 169.145212] kprobe_test: loading out-of-tree module taints kernel. [ 169.149144] kprobe_test: module verification failed: signature and/or required key missing - tainting kernel
[ 169.153539] mod_init():158 :: hello [ 169.154744] mod_init():190 :: kernel version: test/-18/cosmic
[ 169.177027] Program running, TID = 2497 [ 169.177978] kp1_pre_handler():070 :: state 0 .... :: pid = 2497, mapping = 0xffff993df9136fb0, comm = 'test' [ 169.181080] kp1_pre_handler():079 :: state 0 -> 1 :: pid = 2497, mapping = 0xffff993df9136fb0 [ 169.183355] kp2_pre_handler():119 :: state 1 .... :: pid = 2497, page index = 1 [ 169.185616] kp3_pre_handler():144 :: state 1 .... :: pid = 2497, page index = 1, calling writepage() [ 169.187779] kp2_pre_handler():119 :: state 1 .... :: pid = 2497, page index = 2 [ 169.189186] kp3_pre_handler():144 :: state 1 .... :: pid = 2497, page index = 2, calling writepage()
[ 170.194880] Thread 0 running, TID = 2498! [ 170.200011] kp1_pre_handler():070 :: state 1 .... :: pid = 7, mapping = 0xffff993df9136fb0, comm = 'kworker/u4:0' [ 170.217616] kp1_pre_handler():101 :: state 1 -> 2 :: pid = 7, mapping = 0xffff993df9136fb0, comm ('kworker/u4:0') is kworker AND wbc->range_cyclic (0x1) is true AND mapping->writeback_index (0x2) is 0x2. [ 170.238633] kp2_pre_handler():119 :: state 2 .... :: pid = 7, page index = 2 [ 170.248024] kp3_pre_handler():144 :: state 2 .... :: pid = 7, page index = 2, calling writepage() [ 170.261141] kp1_pre_handler():070 :: state 2 .... :: pid = 7, mapping = 0xffff993df9136fb0, comm = 'kworker/u4:0' [ 170.272150] kp2_pre_handler():119 :: state 2 .... :: pid = 7, page index = 1 [ 170.279860] kp2_pre_handler():123 :: state 2 -> 3 :: pid = 7, page index = 1, spin 5 seconds before lock_page()...
[ 171.195090] Thread 1 running, TID = 2499! [ 171.196182] kp1_pre_handler():070 :: state 3 .... :: pid = 2499, mapping = 0xffff993df9136fb0, comm = 'test' [ 171.198609] kp2_pre_handler():119 :: state 3 .... :: pid = 2499, page index = 1 [ 171.200358] kp3_pre_handler():144 :: state 3 .... :: pid = 2499, page index = 1, calling writepage() [ 171.203717] kp2_pre_handler():119 :: state 3 .... :: pid = 2499, page index = 2
[ 172.195297] Thread 2 running, TID = 2500! [ 172.196387] kp1_pre_handler():070 :: state 3 .... :: pid = 2500, mapping = 0xffff993df9136fb0, comm = 'test' [ 172.198673] kp2_pre_handler():119 :: state 3 .... :: pid = 2500, page index = 1 [ 175.252161] kp2_pre_handler():127 :: state 3 -> 4 :: pid = 7, page index = 1, spun 5 seconds before lock_page().
[ 175.254922] kp3_pre_handler():144 :: state 4 .... :: pid = 2499, page index = 2, calling writepage() [ 175.256849] kp3_pre_handler():144 :: state 4 .... :: pid = 2500, page index = 1, calling writepage() [ 175.259166] kp2_pre_handler():119 :: state 4 .... :: pid = 2500, page index = 2 [ 175.273178] mod_exit():213 :: bye
testcase
========
test kernel :: latest cosmic version + patch: ------- ------- ------- ------- ------- --
-------
$ uname -rv
4.18.0-18-generic #19+test20190415b1 SMP Mon Apr 15 15:43:20 UTC 2019
[ 169.145212] kprobe_test: loading out-of-tree module taints kernel.
[ 169.149144] kprobe_test: module verification failed: signature and/or required key missing - tainting kernel
[ 169.153539] mod_init():158 :: hello
[ 169.154744] mod_init():190 :: kernel version: test/-18/cosmic
[ 169.177027] Program running, TID = 2497 handler( ):070 :: state 0 .... :: pid = 2497, mapping = 0xffff993df9136fb0, comm = 'test' handler( ):079 :: state 0 -> 1 :: pid = 2497, mapping = 0xffff993df9136fb0 handler( ):119 :: state 1 .... :: pid = 2497, page index = 1 handler( ):144 :: state 1 .... :: pid = 2497, page index = 1, calling writepage() handler( ):119 :: state 1 .... :: pid = 2497, page index = 2 handler( ):144 :: state 1 .... :: pid = 2497, page index = 2, calling writepage()
[ 169.177978] kp1_pre_
[ 169.181080] kp1_pre_
[ 169.183355] kp2_pre_
[ 169.185616] kp3_pre_
[ 169.187779] kp2_pre_
[ 169.189186] kp3_pre_
[ 170.194880] Thread 0 running, TID = 2498! handler( ):070 :: state 1 .... :: pid = 7, mapping = 0xffff993df9136fb0, comm = 'kworker/u4:0' handler( ):101 :: state 1 -> 2 :: pid = 7, mapping = 0xffff993df9136fb0, comm ('kworker/u4:0') is kworker AND wbc->range_cyclic (0x1) is true AND mapping- >writeback_ index (0x2) is 0x2. handler( ):119 :: state 2 .... :: pid = 7, page index = 2 handler( ):144 :: state 2 .... :: pid = 7, page index = 2, calling writepage() handler( ):070 :: state 2 .... :: pid = 7, mapping = 0xffff993df9136fb0, comm = 'kworker/u4:0' handler( ):119 :: state 2 .... :: pid = 7, page index = 1 handler( ):123 :: state 2 -> 3 :: pid = 7, page index = 1, spin 5 seconds before lock_page()...
[ 170.200011] kp1_pre_
[ 170.217616] kp1_pre_
[ 170.238633] kp2_pre_
[ 170.248024] kp3_pre_
[ 170.261141] kp1_pre_
[ 170.272150] kp2_pre_
[ 170.279860] kp2_pre_
[ 171.195090] Thread 1 running, TID = 2499! handler( ):070 :: state 3 .... :: pid = 2499, mapping = 0xffff993df9136fb0, comm = 'test' handler( ):119 :: state 3 .... :: pid = 2499, page index = 1 handler( ):144 :: state 3 .... :: pid = 2499, page index = 1, calling writepage() handler( ):119 :: state 3 .... :: pid = 2499, page index = 2
[ 171.196182] kp1_pre_
[ 171.198609] kp2_pre_
[ 171.200358] kp3_pre_
[ 171.203717] kp2_pre_
[ 172.195297] Thread 2 running, TID = 2500! handler( ):070 :: state 3 .... :: pid = 2500, mapping = 0xffff993df9136fb0, comm = 'test' handler( ):119 :: state 3 .... :: pid = 2500, page index = 1 handler( ):127 :: state 3 -> 4 :: pid = 7, page index = 1, spun 5 seconds before lock_page().
[ 172.196387] kp1_pre_
[ 172.198673] kp2_pre_
[ 175.252161] kp2_pre_
[ 175.254922] kp3_pre_ handler( ):144 :: state 4 .... :: pid = 2499, page index = 2, calling writepage() handler( ):144 :: state 4 .... :: pid = 2500, page index = 1, calling writepage() handler( ):119 :: state 4 .... :: pid = 2500, page index = 2
[ 175.256849] kp3_pre_
[ 175.259166] kp2_pre_
[ 175.273178] mod_exit():213 :: bye