Skip to content
Snippets Groups Projects

pv-wrap, pv-launcher: Set a reasonable RLIMIT_NOFILE

Merged Simon McVittie requested to merge wip/t29726 into master
All threads resolved!

We could inherit any RLIMIT_NOFILE from Steam or another caller, but we want to give games a predictable execution environment.

If a game uses select(), allocates memory proportional to the soft limit on file descriptors, or loops for a number of iterations proportional to the soft limit on file descriptors (as we did prior to commit 97b5a8f6 "pressure-vessel: Let short-term subprocesses inherit non-CLOEXEC fds"), then file descriptors numerically greater than 1023 are going to be a problem. If the soft limit is more than 1024 (= FD_SETSIZE), reduce it to 1024 to avoid this.

Conversely, if we're launched with a soft limit strictly less than 1024, let's try to raise it to 1024 if the hard limit allows that.

Related to https://github.com/ValveSoftware/steam-for-linux/issues/7970.

Edited by Simon McVittie

Merge request reports

Pipeline #16519 passed

Pipeline passed for 4854d072 on wip/t29726

Merged by Ludovico de NittisLudovico de Nittis 3 years ago (Aug 5, 2021 3:29pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Simon McVittie added 1 commit

    added 1 commit

    • 4854d072 - pv-wrap, pv-launcher: Set a reasonable RLIMIT_NOFILE

    Compare with previous version

  • Simon McVittie changed title from pv-wrap, pv-adverb, pv-launcher: Set a reasonable RLIMIT_NOFILE to pv-wrap, pv-launcher: Set a reasonable RLIMIT_NOFILE

    changed title from pv-wrap, pv-adverb, pv-launcher: Set a reasonable RLIMIT_NOFILE to pv-wrap, pv-launcher: Set a reasonable RLIMIT_NOFILE

  • Simon McVittie resolved all threads

    resolved all threads

  • Simon McVittie requested review from @denittis

    requested review from @denittis

  • assigned to @smcv

  • added Enhancement ~37 labels

  • Ludovico de Nittis approved this merge request

    approved this merge request

  • mentioned in commit d60a441e

  • Please register or sign in to reply
    Loading