Author Topic: kernel: INFO: task kjournald: blocked for more than 120  (Read 6574 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
kernel: INFO: task kjournald: blocked for more than 120
« on: กันยายน 22, 2014, 03:47:59 PM »
พอดีช่วงนี้ เจอ error ในส่วนของ kernel ตัว Centos 5.10 X86 มี error ขึ้นประมาณนี้ ครับผม

############# End of message log #####################
Sep 22 03:21:26 ns9 kernel: INFO: task httpd:22077 blocked for more than 120 seconds.
Sep 22 03:21:26 ns9 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Sep 22 03:21:26 ns9 kernel: httpd         D ffff810127651000     0 22077  17295         22079 22076 (NOTLB)
Sep 22 03:21:26 ns9 kernel:  ffff8100464a7d98 0000000000000086 ffff81012fa7c2c0 ffff8100a8363228
Sep 22 03:21:26 ns9 kernel:  ffff8100464a7ea8 0000000000000001 ffff8100aa00b040 ffff81005beb8080
Sep 22 03:21:26 ns9 kernel:  0000799524bed621 000000000014fb21 ffff8100aa00b228 0000000200000000
Sep 22 03:21:26 ns9 kernel: Call Trace:
Sep 22 03:21:26 ns9 kernel:  [<ffffffff8805c4b8>] :ext3:ext3_get_acl+0x63/0x310
Sep 22 03:21:26 ns9 kernel:  [<ffffffff8803200f>] :jbd:start_this_handle+0x2e9/0x370
Sep 22 03:21:26 ns9 kernel:  [<ffffffff800a3fa2>] autoremove_wake_function+0x0/0x2e
Sep 22 03:21:26 ns9 kernel:  [<ffffffff88032161>] :jbd:journal_start+0xcb/0x102
Sep 22 03:21:26 ns9 kernel:  [<ffffffff88050ede>] :ext3:ext3_dirty_inode+0x28/0x7b
Sep 22 03:21:26 ns9 kernel:  [<ffffffff80013de2>] __mark_inode_dirty+0x29/0x16e
Sep 22 03:21:26 ns9 kernel:  [<ffffffff800226af>] generic_file_mmap+0x2e/0x3f
Sep 22 03:21:26 ns9 kernel:  [<ffffffff8000e186>] do_mmap_pgoff+0x4d6/0x7bd
Sep 22 03:21:26 ns9 kernel:  [<ffffffff800bb2cd>] audit_syscall_entry+0x1a8/0x1d3
Sep 22 03:21:26 ns9 kernel:  [<ffffffff800d3692>] sys_mmap_pgoff+0x74/0xac
Sep 22 03:21:26 ns9 kernel:  [<ffffffff8005d29e>] tracesys+0xd5/0xdf

############# End of message log #####################

หลังจากขึ้น log แบบนี้แล้วก็ทำให้เครื่อง hang ไปเลย ssh เข้าไม่ได้ หลังจากเชคดู log message ก็เจอ error ประมาณนี้ ครับ

หลังจากทำการเชคกับทาง Centos.org ก็พบว่าเป็นเกี่ยวกับเรื่อง Complete Fair Queuing (CFQ) ที่พูดถึงการทำงานของตัว process I/O queue
โดยเราทำการเชคได้ว่า ภายใน os เรา support scheduler แบบไหนบ้างได้โดย

#cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]
แสดงว่ามีการใช้งานตัว [cfq] อยู่

ผมเลยลองปรับมาเป็นแบบ noop ดูซึ่งทาง CentOS ก็แนะนำในลักษณะอย่างนั้น
#vi /etc/grub.conf

โดยเพิ่มในส่วนของ elevator=noop ลงไปในบันทัด kernel ที่ท่านใช้งานอยู่
        kernel /vmlinuz-2.6.18-xxxx elevator=noop
แล้วทำการ reboot server 1 รอบ

หลังจากเครื่องอัฟแล้ว ลองทำการ เชค scheduler อีกที
#cat /sys/block/sda/queue/scheduler
[noop] anticipatory deadline cfq


##Complete Fair Queuing (CFQ) ที่พูดถึงการทำงานของตัว process I/O queue

The CFQ elevator implements a QoS (Quality of Service) policy for processes by maintaining per-process I/O queues. The CFQ elevator is well suited for large multiuser systems with a lot of competing processes. It aggressively attempts to avoid starvation of
processes and features low latency. Starting with kernel release 2.6.18 the improved CFQ elevator is the default I/O scheduler. Depending on the system setup and the workload characteristics, the CFQ scheduler can slowdown a single main application, for example a massive database with its fairness oriented algorithms.

##NOOP
NOOP stands for No Operation, and the name explains most of its functionality. The NOOP elevator is simple and lean. It is a simple FIFO queue that does not perform any data ordering. NOOP simply merges adjacent data requests, so it adds very low processor overhead to disk I/O. The NOOP elevator assumes that a block device either features its own elevator algorithm such as TCQ for SCSI, or that the block device has no seek latency such as a flash card.

With the Linux kernel release 2.6.18 the I/O elevators are now selectable on a per disk subsystem basis and no longer need to be set on a per system level.

##reference
http://bugs.centos.org/view.php?id=4515
http://www.gnutoolbox.com/linux-io-elevator/
http://blog.nashcom.de/nashcomblog.nsf/dx/linux-io-performance-tweek.htm