kernel: INFO: task khugepaged:342 blocked for more than 120 seconds解决办法

报错信息:


Jun  4 19:30:02 newsclient kernel: INFO: task khugepaged:342 blocked for more than 120 seconds.

Jun  4 19:30:02 newsclient kernel:      Tainted: G           --------------- H  2.6.32-431.el6.x86_64 #1
Jun  4 19:30:02 newsclient kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jun  4 19:30:02 newsclient kernel: khugepaged    D 0000000000000001     0   342      2 0x00000000
Jun  4 19:30:02 newsclient kernel: ffff880c6a375c88 0000000000000046 0000000000000000 0000000000000001
Jun  4 19:30:02 newsclient kernel: ffff880caa616840 0000000000000000 0000000000000000 0000000000016840
Jun  4 19:30:02 newsclient kernel: ffff880c6a31c638 ffff880c6a375fd8 000000000000fbc8 ffff880c6a31c638
Jun  4 19:30:02 newsclient kernel: Call Trace:
Jun  4 19:30:02 newsclient kernel: [<ffffffff81059216>] ? enqueue_task+0x66/0x80
Jun  4 19:30:02 newsclient kernel: [<ffffffff8108412c>] ? lock_timer_base+0x3c/0x70
Jun  4 19:30:02 newsclient kernel: [<ffffffff81529f85>] rwsem_down_failed_common+0x95/0x1d0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8152a116>] rwsem_down_read_failed+0x26/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff81084240>] ? process_timeout+0x0/0x10
Jun  4 19:30:02 newsclient kernel: [<ffffffff8128e854>] call_rwsem_down_read_failed+0x14/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff81529614>] ? down_read+0x24/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff811816df>] khugepaged+0x18f/0x1310
Jun  4 19:30:02 newsclient kernel: [<ffffffff8109b2a0>] ? autoremove_wake_function+0x0/0x40
Jun  4 19:30:02 newsclient kernel: [<ffffffff81181550>] ? khugepaged+0x0/0x1310
Jun  4 19:30:02 newsclient kernel: [<ffffffff8109aef6>] kthread+0x96/0xa0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8100c20a>] child_rip+0xa/0x20
Jun  4 19:30:02 newsclient kernel: [<ffffffff8109ae60>] ? kthread+0x0/0xa0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8100c200>] ? child_rip+0x0/0x20
Jun  4 19:30:02 newsclient kernel: INFO: task java:176646 blocked for more than 120 seconds.
Jun  4 19:30:02 newsclient kernel:      Tainted: G           --------------- H  2.6.32-431.el6.x86_64 #1
Jun  4 19:30:02 newsclient kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jun  4 19:30:02 newsclient kernel: java          D 000000000000001a     0 176646      1 0x00000000
Jun  4 19:30:02 newsclient kernel: ffff880c6538dcf0 0000000000000082 ffffea0031fd23a8 000002006538dc78
Jun  4 19:30:02 newsclient kernel: ffff880e48535e78 ffff880c00000005 0000000000000de8 00007fbb465cf000
Jun  4 19:30:02 newsclient kernel: ffff880c6b1c9af8 ffff880c6538dfd8 000000000000fbc8 ffff880c6b1c9af8
Jun  4 19:30:02 newsclient kernel: Call Trace:
Jun  4 19:30:02 newsclient kernel: [<ffffffff8114a657>] ? handle_pte_fault+0xf7/0xb00
Jun  4 19:30:02 newsclient kernel: [<ffffffff81529f85>] rwsem_down_failed_common+0x95/0x1d0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8105571d>] ? check_preempt_curr+0x6d/0x90
Jun  4 19:30:02 newsclient kernel: [<ffffffff81065c5e>] ? try_to_wake_up+0x24e/0x3e0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8152a116>] rwsem_down_read_failed+0x26/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff8128e854>] call_rwsem_down_read_failed+0x14/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff81529614>] ? down_read+0x24/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff8104a92e>] __do_page_fault+0x18e/0x480
Jun  4 19:30:02 newsclient kernel: [<ffffffff81527910>] ? thread_return+0x4e/0x76e
Jun  4 19:30:02 newsclient kernel: [<ffffffff8152d45e>] do_page_fault+0x3e/0xa0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8152a815>] page_fault+0x25/0x30
Jun  4 19:30:02 newsclient kernel: INFO: task java:176753 blocked for more than 120 seconds.
Jun  4 19:30:02 newsclient kernel:      Tainted: G           --------------- H  2.6.32-431.el6.x86_64 #1
Jun  4 19:30:02 newsclient kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jun  4 19:30:02 newsclient kernel: java          D 0000000000000008     0 176753      1 0x00000000
Jun  4 19:30:02 newsclient kernel: ffff880cbacdbcf0 0000000000000082 0000000000000000 00000404bacdbc78
Jun  4 19:30:02 newsclient kernel: ffffffff8104fae6 ffff880c00000029 0000000000000de9 00007fbb465d0000
Jun  4 19:30:02 newsclient kernel: ffff880db17745f8 ffff880cbacdbfd8 000000000000fbc8 ffff880db17745f8
Jun  4 19:30:02 newsclient kernel: Call Trace:
Jun  4 19:30:02 newsclient kernel: [<ffffffff8104fae6>] ? native_flush_tlb_others+0x76/0x90
Jun  4 19:30:02 newsclient kernel: [<ffffffff8114a657>] ? handle_pte_fault+0xf7/0xb00
Jun  4 19:30:02 newsclient kernel: [<ffffffff81529f85>] rwsem_down_failed_common+0x95/0x1d0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8105572c>] ? check_preempt_curr+0x7c/0x90
Jun  4 19:30:02 newsclient kernel: [<ffffffff81065c5e>] ? try_to_wake_up+0x24e/0x3e0
Jun  4 19:30:02 newsclient kernel: [<ffffffff8152a116>] rwsem_down_read_failed+0x26/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff8128e854>] call_rwsem_down_read_failed+0x14/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff81529614>] ? down_read+0x24/0x30
Jun  4 19:30:02 newsclient kernel: [<ffffffff8104a92e>] __do_page_fault+0x18e/0x480
Jun  4 19:30:02 newsclient kernel: [<ffffffff810129de>] ? copy_user_generic+0xe/0x20
Jun  4 19:30:02 newsclient kernel: [<ffffffff810179ab>] ? check_for_xstate+0x3b/0x90
Jun  4 19:30:02 newsclient kernel: [<ffffffff8152d45e>] do_page_fault+0x3e/0xa0

Jun  4 19:30:02 newsclient kernel: [<ffffffff8152a815>] page_fault+0x25/0x30



解决办法:
/etc/sysctl.conf

添加

vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
sysctl -p
参考:
https://www.blackmoreops.com/2014/09/22/linux-kernel-panic-issue-fix-hung_task_timeout_secs-blocked-120-seconds-problem/