drop_caches operation never completes due to an infinite loop in drop_slab_node()

Solution Unverified - Updated -

Issue

  • drop_caches operation (echo 2 > /proc/sys/vm/drop_caches) hangs and never completes.
  • According to the perf report analysis, it clearly seems like an infinite loop in drop_slab_node():
Samples: 795K of event 'cycles', Event count (approx.): 628039662176
  Overhead  Command  Shared Object
-   99.83%  bash     [kernel.vmlinux]                              ▒
   - 78.48% mem_cgroup_iter                                        ▒
        drop_slab_node                                             ▒
        drop_slab                                                  ▒
        drop_caches_sysctl_handler                                 ▒
        proc_sys_call_handler                                      ▒
        vfs_write                                                  ▒
        ksys_write                                                 ▒
        do_syscall_64                                              ▒
        entry_SYSCALL_64_after_hwframe                             ▒
        0x7ffff76f8bc8                                             ▒
        0                                                          ▒
   - 13.14% css_next_descendant_pre                                ▒
        mem_cgroup_iter                                            ▒
        drop_slab_node                                             ▒
        drop_slab                                                  ▒
        drop_caches_sysctl_handler                                 ▒
        proc_sys_call_handler                                      ▒
        vfs_write                                                  ▒
        ksys_write                                                 ▒
        do_syscall_64                                              ▒
        entry_SYSCALL_64_after_hwframe                             ▒
        0x7ffff76f8bc8                                             ▒
        0                                                          ◆
   - 3.69% percpu_ref_put_many.constprop.80                        ▒
      - 3.69% mem_cgroup_iter                                      ▒
           drop_slab_node                                          ▒
           drop_slab                                               ▒
           drop_caches_sysctl_handler                              ▒
           proc_sys_call_handler                                   ▒
           vfs_write                                               ▒
           ksys_write                                              ▒
           do_syscall_64                                           ▒
           entry_SYSCALL_64_after_hwframe                          ▒
           0x7ffff76f8bc8                                          ▒
           0                                                       ▒
   + 1.25% shrink_slab                                             ▒
   + 0.68% drop_slab_node                                          ▒
        ...

Environment

  • Kernels older than RHEL8.9 GA
  • drop_caches

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