SUSE Support

Here When You Need Us

Reading /proc/<pid>/maps and /proc/<pid>/numa_maps takes long

This document (7019001) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server for SAP Applications 12
SUSE Linux Enterprise Server for SAP Applications 12 Service Pack 1

Situation

With an increasing number of [stack:<TID>] entries in /proc/<pid>/maps and /proc/<pid>/numa_maps, the time spend on reading these entries takes tremendously longer.

Applications  accessing these files of processes with many threads can show a wide variety of misbehavior (crashes, freezing, high resource consumption, etc.).

Resolution

SUSE Linux Enterprise Server 12
  • Update the Linux kernel at least to 3.12.61-52.72.1
SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
  • Update the Linux kernel at least to 3.12.74-60.64.40.1

The code creating one stack entry per thread has been removed

- revert "procfs: mark thread stack correctly in proc/PID/maps" (bnc#1030901).

Cause

The files /proc/<pid>/maps and /proc/<pid>/numa_maps have one  [stack:<TID>] entry for every thread. The time calculating the data for them grows in a quadratic fashion with the amount of the entries.

Additional Information

To verify if accessing the map file can cause issues, monitor the time reading it and the count of the stack entries. Here an example with process 853:
time cat /proc/853/maps > /dev/null

real 0m22.82s
user 0m0.01s
sys 0m20.98s

grep stack: /proc/853/maps | wc -l
682901
More details about the problem can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=65376df582174ffcec9e6471bf5b0dd79ba05e4a.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7019001
  • Creation Date: 17-May-2017
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.