[X/B][PATCH] mm: do not stall register_shrinker()

You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.

  Regular D-state processes impacting LXD containers

Status in linux package in Ubuntu:
Status in linux source package in Xenial:
Status in linux source package in Bionic:

Bug description:

   * Systems running under memory pressure may hit stalls in the
     order of seconds to minutes in systemd-logind and lxd mount
     operations (e.g., ZFS backend), which get stuck in D state.

   * The processes stuck in D state have a common stack trace,
     (cat /proc/PID/stack) all blocked in register_shrinker().

   * The fix checks in shrink_slab() (shrinkers are called under
     memory pressure) for contention/usage of the semaphore used
     by register_shrinker() and returns early in that case.

     This allows the register_shrinker() callers to unblock,
     and not stall until the shrink operation releases that lock.

  [Test Case]

   * In a system under memory pressure, specifically having the
     memory shrinkers being called often and taking time to run,
     perform mount operations (or other operations that acquire
     the shrinker_rwsem semaphore).

   * The user who reported the problem has verified the fix in
     systems that exhibted the problem often (sometimes daily),
     and tells it resolves the problem.

  [Regression Potential]

   * Low. The fix just returns early from slab memory shrinker
     if there's usage/contention for 'shrinker_rwsem'.

   * In some scenarios, this may cause the slab memory shrinker
     to require more invocations to actually finish and potentially
     release memory, but this seems minor since other shrinkers can
     release memory as well, and compared to the fact that this fix
     allows other applications to make progress / continue to run,
     which would otherwise be stalled.

  [Other Info]
   * This patch is already applied in Cosmic and later (v4.16+).
     It is needed only in Xenial and Bionic at this time.

To manage notifications about this bug go to:

Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to