RHEL 8: The task `oom_reaper` is blocked at mutex_lock() when oom occurs

Solution Verified - Updated -

Issue

  • The task oom_reaper is blocked at oom_reaper() with following logs:
OOm happened.
[  127.854681] Out of memory: Killed process 1762 (usemem) total-vm:1052912kB, anon-rss:8996kB, file-rss:4kB, shmem-rss
:0kB, UID:0
[  162.773503] INFO: task oom_reaper:26 blocked for more than 30 seconds.
[  162.774855]       Not tainted 4.18.0-193.40.1.el8_2.x86_64 #1
[  162.775987] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  162.777478] oom_reaper      D    0    26      2 0x80004000
[  162.778532] Call Trace:
[  162.779025]  ? __schedule+0x24f/0x650
[  162.779740]  ? __switch_to_asm+0x41/0x70
[  162.780498]  ? __switch_to_asm+0x41/0x70
[  162.781264]  schedule+0x2f/0xa0
[  162.781909]  schedule_preempt_disabled+0xa/0x10
[  162.782825]  __mutex_lock.isra.5+0x2d0/0x4a0
[  162.783698]  ? __switch_to_asm+0x41/0x70
[  162.784490]  ? prepare_to_wait_event+0xbb/0x140
[  162.785443]  ? __oom_reap_task_mm+0x100/0x100
[  162.786427]  oom_reaper+0x95/0x380
[  162.787140]  ? finish_wait+0x80/0x80
[  162.787870]  ? __oom_reap_task_mm+0x100/0x100
[  162.788744]  kthread+0x112/0x130
[  162.789392]  ? kthread_flush_work_fn+0x10/0x10
[  162.790277]  ret_from_fork+0x35/0x40

Environment

  • Red Hat Enterprise Linux 8
  • Out of memory

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content