Why negative-dentry-limit sysctl parameter is not available in Red Hat Enterprise Linux 8?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 8

Issue

  • Why negative-dentry-limit sysctl parameter is not available in Red Hat Enterprise Linux 8 ?
  • How Red Hat Enterprise Linux 8 handles negative-dentry-limit situation ?

Resolution

  • The negative-dentry-limit sysctl parameter is specifically added in RHEL-7 kernel. RHEL-8 kernel is based on the latest upstream kernel and it is capable of handling the negative dentries situation. However, RHEL-7 kernel was not built to handle the negative dentries properly. Backporting the relevant patch from upstream into RHEL-7 kernel was not possible as it was causing disruption in the code. Hence, to avoid the situation the new sysctl parameter negative-dentry-limit was specifically added into RHEL-7.8 kernel code path.

Root Cause

  • Changelog:
# rpm -q kernel --changelog | grep negative-dentry-limit
- [fs] fs/dcache: Add sysctl parameter negative-dentry-limit as a soft limit on negative dentries (Waiman Long) [1489573]
  • Snippet from the patchset:
    [fs] fs/dcache: Add sysctl parameter negative-dentry-limit as a soft limit on negative dentries
------------>8--------------->8----------------->8-------------->8-------------

    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1489573
    Upstream Status: RHEL only

    The upstream kernel is able to gracefully handle an avalanche of new
    negative dentries by invoking memory reclaim to free excess dentries.
    RHEL7 kernel, however, is unable to gracefully handle that leading to OOM
    in some cases. Kernel memory cgroup in RHEL7 is not able to limit memory
    consumed by slab cache either. Backporting the relevant upstream patches
    will be too intrusive. So we need some RHEL7 specific solution to handle
    this problem.

    A new sysctl parameter "negative-dentry-limit" is added to /proc/sys/fs
    whose value represents a soft limit on the total number of negative
    dentries allowable in a system as a multiple of one-thousandth of the
    total system memory available.  IOW, each unit represents 0.1% of the
    total memory.  The allowable range for this new parameter is 0-100
    where 0 means no soft limit and 100 means 10% of total system memory.

    The actual dentry reclaim to enforce the limit will be done in a
    subsequent patch.
------------>8--------------->8----------------->8-------------->8-------------

</snip>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments