Project

General

Profile

Actions

Bug #11871

closed

smatch should not hammer linux procfs path

Added by Patrick Mooney over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
tools - gate/build tools
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

While waiting for an illumos-joyent build, I was perusing lockstat(1) output and observed what seemed to be unusually high contention in some VFS codepaths. Further investigation lead me to smatch, which was repeatedly attempting to open /proc/self/statm as part of an API for process memory accounting. Not only is that a Linux /proc path that is missing on illumos, the logic makes no attempt at caching the file descriptor. It would be nice to:
1. Use /proc/self/psinfo for meaningful data
2. Cache the open fd, so we don't need to repeatedly hammer open/read/close

Actions #1

Updated by John Levon over 2 years ago

I tested Patrick's changes with several repeated builds.

Actions #2

Updated by Electric Monk over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit a0ee54468d6e6b136d1ca470a03bb44165c66e6e

commit  a0ee54468d6e6b136d1ca470a03bb44165c66e6e
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2019-10-29T14:41:10.000Z

    11871 smatch should not hammer linux procfs path
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF